bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Failed bash -r command returns 0 exit status


From: Greg Wooledge
Subject: Re: Failed bash -r command returns 0 exit status
Date: Mon, 24 May 2010 08:32:03 -0400
User-agent: Mutt/1.4.2.3i

On Mon, May 24, 2010 at 04:25:48AM -0400, Dave Rutherford wrote:
> On Mon, May 24, 2010 at 02:48, Pitt, David <David.Pitt@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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]