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?
Thanks,
Romain
--
Romain Tartière <[email protected]> http://romain.blogreen.org/
pgp: 8DAB A124 0DA4 7024 F82A E748 D8E9 A33F FF56 FF43 (ID: 0xFF56FF43)
(plain text =non-HTML= PGP/GPG encrypted/signed e-mail much appreciated)
pgp6HLk0w7zQx.pgp
Description: PGP signature
