in reply to Windows: system("type ...") vs. system("cmd /c type ...")

I reckon I've been bitten by this before, though it was a while ago, and I'm a little hazy on the details. But, if I've got it right, there's a 'type.exe' in your path that's being invoked (instead of the shell's 'type' command). To make sure you get the shell's 'type' command I think you can also run something like:
perl -e "system('type myfile.txt') <NUL"
Does that produce expected results ?

Cheers,
Rob
Update: The above command might not be quite correct. In order to invoke the shell's 'type' command, I think it should have been written as:
perl -e "system('type myfile.txt <NUL')"
Of course, on most systems (such as mine), it won't matter - as the shell's 'type' command gets invoked, anyway.

Replies are listed 'Best First'.
Re^2: Windows: system("type ...") vs. system("cmd /c type ...")
by rovf (Priest) on Nov 17, 2008 at 12:34 UTC
    if I've got it right, there's a 'type.exe' in your path that's being invoked

    Of course, that's it!!!! Ahhh, stupid me, I've stumbled over this already a few months ago, and completely forgotten!!!!!!! Arrrrrrgh, did the same mistake twice! Thanks for helping!

    -- 
    Ronald Fischer <ynnor@mm.st>