in reply to system call works on *nix not NT

Thinking a little out of the box, and your dumb arse comment made me think simple and I have no idea how to use rsh so I tried with dir using the following.
perl -e 'system("dir")' #failed perl -e 'system(\"dir\")' #failed perl -e system("dir") #worked perl -e system(\"dir\") #worked
If you posting is exactly what you type, could this be the be the answer?

Replies are listed 'Best First'.
Re^2: system call works on *nix not NT
by beable (Friar) on Jul 01, 2004 at 22:13 UTC

    Oh yeah, of course that's what I was trying to remember. Quoting is different on DOS boxes. Try this instead:

    perl -e "system(\"rsh hostname -l username -n \"touch test\"\")"

    From memory (sorry I don't have a Windows box to test on), single quotes don't work very well in the MSDOS prompt. So you need to use double quotes instead. And then you need to escape the double quotes inside the double quotes, or else use single quotes which Perl can handle:

    perl -e "system('rsh hostname -l username -n \'touch test\'')"