[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: set -e and subshells
From: |
Jon Salz |
Subject: |
Re: set -e and subshells |
Date: |
Mon, 26 Sep 2005 23:46:39 -0400 |
On Mon, 2005-09-26 at 21:39 -0600, Bob Proulx wrote:
> Jon Salz wrote:
> > I'm noticing a difference in behavior between Solaris 9's sh and GNU
> > bash, and was wondering if this is a bug or a feature.
>
> I believe Solaris' sh is the Bourne shell. I am told that to get a
> POSIX shell on Solaris you would need to invoke /usr/XPG4/bin/sh. Can
> you try your experiment with Solaris' POSIX shell?
>
> /usr/XPG4/bin/sh -exc 'for x in a b c; do ( false ); echo status is $?;
> done'
>
> For what it is worth HP-UX /bin/sh behaves the same as bash for this
> case.
>
> Bob
>
Sure:
/usr/xpg4/bin/sh -exc 'for x in a b c; do ( false ); echo status is $?; done'
+ false
- Jon