On Sun, Jul 19, 2009 at 10:26:38PM +0200, Romain Tartière wrote: > Hi! > > Simple test case: > > ----8<---------------------- > #!/bin/sh > foo() > { > echo "\$?=$? \$1=$1" > } > false > foo $? > ----8<---------------------- > > % sh foo.sh > $?=0 $1=1 > % zsh foo.sh > $?=1 $1=1 > % bash foo.sh > $?=1 $1=1 > > As you can see, the value of $? is « lost » when FreeBSD sh enters a > function. Is this supposed to behave this way?
This has been fixed in 8.x: Revision 185231 - Directory Listing Modified Sun Nov 23 20:23:57 2008 UTC (7 months, 3 weeks ago) by stefanf Fix $? at the first command of a function. The previous exit status was saved twice and thus lost. -- Jilles Tjoelker _______________________________________________ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"