bin/81165: /bin/sh -e bug

Simon Marlow simonmar at
Tue May 17 16:30:07 GMT 2005

>Number:         81165
>Category:       bin
>Synopsis:       /bin/sh -e bug
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue May 17 16:30:00 GMT 2005
>Originator:     Simon Marlow
>Release:        FreeBSD 4.11-STABLE i386
System: FreeBSD 4.11-STABLE FreeBSD 4.11-STABLE #43: Sun Jan 23 00:11:26 GMT 2005 simonm at i386

There is a bug in ash's handling of the -e flag.  See the example below.


$ cat >
if true; then
  false && true
echo "test succeeded"
$ /bin/sh -e
zsh: 34546 exit 1     /bin/sh -e
$ bash -e
test succeeded

Bash works correctly.  If the 'if' statement is removed, ash also
works correctly.




More information about the freebsd-bugs mailing list