On Mon, May 24, 2010 at 08:32, Greg Wooledge <wool...@eeg.ccf.org> wrote: > On Mon, May 24, 2010 at 04:25:48AM -0400, Dave Rutherford wrote: >> On Mon, May 24, 2010 at 02:48, Pitt, David <david.p...@anz.com> wrote: >> > status. This is not expected (at least not by me!). Zero exit >> > status is returned with >> > any list of commands, e.g. "/bin/ls && :". >> >> That one would, since the second command is 'true'. Replace it >> with 'false' and you should see an exit status of 1. > > You're confused. In a regular shell, the if the /bin/ls fails, the && > part never gets executed at all, and the entire thing returns non-zero. > > $ bash -c 'false && :'; echo $? > 1
But it didn't fail because it wasn't run.