On Wed, Aug 30, 2006 at 01:01:06AM -0400, Paul Jarc wrote:
> Greg Schafer <[EMAIL PROTECTED]> wrote:
> > Thanks for trying to clarify it for me. Let me put it another way: If I
> > change Line 1 above to an if/then style statement instead of "&&" ie:
> >
> > if false; then echo false; fi
> >
> >
Greg Schafer <[EMAIL PROTECTED]> wrote:
> Thanks for trying to clarify it for me. Let me put it another way: If I
> change Line 1 above to an if/then style statement instead of "&&" ie:
>
> if false; then echo false; fi
>
> it works exactly like I'd expect instead of the counter-intuitive behavio
On Wed, Aug 30, 2006 at 04:28:35AM +, Eric Blake wrote:
> > > > #!/bin/sh
> > > > set -e
> > > >
> > > > func () {
> > > > false && echo false
> > > > true && echo true
> > > > false && echo false
> ^^^ Line 1
>
> > > > }
> > > >
> > > > func
> ^^^ Line 2
>
> > > >
> > > > echo done
> >
> > > #!/bin/sh
> > > set -e
> > >
> > > func () {
> > > false && echo false
> > > true && echo true
> > > false && echo false
^^^ Line 1
> > > }
> > >
> > > func
^^^ Line 2
> > >
> > > echo done
> > >
> I'll take your word for it.. but I'm not totally convinced. At the very
> least, this b
On Wed, Aug 30, 2006 at 12:03:51AM -0400, Paul Jarc wrote:
> Greg Schafer <[EMAIL PROTECTED]> wrote:
> > #!/bin/sh
> > set -e
> >
> > func () {
> > false && echo false
> > true && echo true
> > false && echo false
> > }
> >
> > func
> >
> > echo done
> >
> >
> > It never echoes "done" because
Greg Schafer <[EMAIL PROTECTED]> wrote:
> #!/bin/sh
> set -e
>
> func () {
> false && echo false
> true && echo true
> false && echo false
> }
>
> func
>
> echo done
>
>
> It never echoes "done" because func() returns 1.
That's the correct behavior. The last "false" within the function
does
Hi
Here's a test case which demonstrates the problem:
#!/bin/sh
set -e
func () {
false && echo false
true && echo true
false && echo false
}
func
echo done
It never echoes "done" because func() returns 1. This seems to go against
what the bash manual says about "set -e"
"Exit immedia