autoconf-patches
[Top][All Lists]
Advanced

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

Re: more shell portability docs


From: Noah Misch
Subject: Re: more shell portability docs
Date: Wed, 14 May 2008 10:33:49 -0700
User-agent: Mutt/1.5.9i

On Wed, May 14, 2008 at 02:29:09PM +0000, Eric Blake wrote:
> Does anyone have access to FreeBSD, or know what shell heritage their /bin/sh 
> has?  This patch was extracted from reports on the git mailing list against 
> the 
> FreeBSD 6.1 /bin/sh, which I don't have access to.  But I reproduced the 
> issues 
> using cygwin's ash, so I'm documenting them.

Indeed, ash and {Free,Net}BSD /bin/sh have a common origin.

> http://marc.info/?l=git&m=121073772610342&w=2
> corrupted $? when combining && and |
> 
> $ sh -c 'true && ! true | true; echo $?'
> 1
> $ ash -c 'true && ! true | true; echo $?'
> 0

This bug is unrelated to `&&', affecting any `!'-ed pipeline:

$  sh -c '! : | :'; echo $?
1
$ ash -c '! : | :'; echo $?
0

Ash evaluates the pipeline like `{ ! :; } | :'.  Also note this bug affecting
`!' with a compound command.

$  sh -c '! { :; }'
$ ash -c '! { :; }'
{: not found
Syntax error: "}" unexpected




reply via email to

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