From: Graham Menhennitt Date: 2012-10-12T18:09:28+09:00 Subject: Re: && should work in a system call? On 11/10/2012 05:26, Roger Pack wrote: >>>> system("ls && ls") >>>> ls: &&: No such file or directory >>>> ls: ls: No such file or directory >>>> => false >>> I see now that it works in Linux, but not windows. I'm guessing this >>> is a bug, but feedback is welcome... >> There is not `ls` command on Windows (unless you install cygwin / >> mingw yourself). You're looking for `dir`. > In this case, I have one: > > $ whichr ls > higher in the list is executed first > C:\installs\devkit451\devkit451\bin\ls.exe > C:\Program Files (x86)\Git\bin\ls.exe > > But it seems you can substitute any executable name in there to get > the offending behavior... > -r > This is purely an educated guess... it possibly matters whether you have a SHELL environment variable set. If you do and it's set to bash or sh or csh, I think that this will work correctly. If it's not set, you'll get the Windows shell: cmd.exe - I don't think that it will grok &&. Graham