From owner-freebsd-stable@FreeBSD.ORG Sun Jul 19 20:26:40 2009 Return-Path: Delivered-To: stable@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BDC4106566B for ; Sun, 19 Jul 2009 20:26:40 +0000 (UTC) (envelope-from romain@blogreen.org) Received: from marvin.blogreen.org (unknown [IPv6:2a01:e35:2f7d:58c0:0:2:1:2]) by mx1.freebsd.org (Postfix) with ESMTP id 122178FC18 for ; Sun, 19 Jul 2009 20:26:40 +0000 (UTC) (envelope-from romain@blogreen.org) Received: by marvin.blogreen.org (Postfix, from userid 1001) id 0511F5C8FA; Sun, 19 Jul 2009 22:26:39 +0200 (CEST) Date: Sun, 19 Jul 2009 22:26:38 +0200 From: Romain =?iso-8859-1?Q?Tarti=E8re?= To: stable@FreeBSD.org Message-ID: <20090719202638.GA85228@blogreen.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VbJkn9YxBvnuCH5J" Content-Disposition: inline User-Agent: Mutt/1.4.2.3i X-PGP-Key: http://romain.blogreen.org/pubkey.asc Cc: Subject: Value of $? lost in the beginning of a function. X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2009 20:26:40 -0000 --VbJkn9YxBvnuCH5J Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! Simple test case: ----8<---------------------- #!/bin/sh foo() { echo "\$?=3D$? \$1=3D$1" } false foo $? ----8<---------------------- % sh foo.sh $?=3D0 $1=3D1 % zsh foo.sh $?=3D1 $1=3D1 % bash foo.sh $?=3D1 $1=3D1 As you can see, the value of $? is =AB lost =BB when FreeBSD sh enters a function. Is this supposed to behave this way? Thanks, Romain --=20 Romain Tarti=E8re http://romain.blogreen.org/ pgp: 8DAB A124 0DA4 7024 F82A E748 D8E9 A33F FF56 FF43 (ID: 0xFF56FF43) (plain text =3Dnon-HTML=3D PGP/GPG encrypted/signed e-mail much appreciated) --VbJkn9YxBvnuCH5J Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (FreeBSD) iEYEARECAAYFAkpjgX4ACgkQ2OmjP/9W/0O9QACgkZizpSZ0b1ob7W8m+GDa8+5p js0An1LmFZ+hBCWiFe+LmVIkh1LGm2o2 =2Qr+ -----END PGP SIGNATURE----- --VbJkn9YxBvnuCH5J--