autoconf-patches
[Top][All Lists]
Advanced

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

zsh $? on empty command (was: AS_IF breakage)


From: Eric Blake
Subject: zsh $? on empty command (was: AS_IF breakage)
Date: Wed, 13 May 2009 06:26:59 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.6.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Eric Blake on 4/14/2009 7:09 PM:
>>> $ zsh -c 'emulate sh; false; $empty; echo $?'
>>> 1
>> Present in zsh 4.3.6, not present in zsh 4.3.4, BTW.
> 
> I'm still trying to figure out where best to document this in the manual.

Done as follows:

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkoKvJMACgkQ84KuGfSFAYA02wCfXJTQd8eP097u6KZw8D+IJUkt
CX8AnRUzCekqSGbz8/XuEy7mVd/s1wIY
=kBXt
-----END PGP SIGNATURE-----
>From 780a068d297868cf3dd617ef12676cbfc3a05862 Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Mon, 4 May 2009 10:30:16 -0600
Subject: [PATCH] Document zsh bug with empty commands.

* doc/autoconf.texi (Special Shell Variables) <?>: Add mention of
more problems with $?.
---
 ChangeLog         |    6 ++++++
 doc/autoconf.texi |   15 +++++++++++++++
 2 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e6e8892..88f4171 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-05-13  Eric Blake  <address@hidden>
+
+       Document zsh bug with empty commands.
+       * doc/autoconf.texi (Special Shell Variables) <?>: Add mention of
+       more problems with $?.
+
 2009-05-11  Patrick Welche  <address@hidden>  (tiny change)

        Also try X11R7 when looking for X11 files, for NetBSD.
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index a4bb429..928b417 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -14925,6 +14925,20 @@ Special Shell Variables

 @c Alphabetical order, case insensitive, `A' before `a'.
 @table @code
address@hidden ?
+Not all shells correctly reset @samp{$?} after conditionals (@pxref{if,
+, Limitations of Shell Builtins}).  Not all shells manage @samp{$?}
+correctly in shell functions (@pxref{Shell Functions}) or in traps
+(@pxref{trap, , Limitations of Shell Builtins}).  Not all shells reset
address@hidden to zero after an empty command.
+
address@hidden
+$ @kbd{bash -c 'false; $empty; echo $?'}
+0
+$ @kbd{zsh -c 'false; $empty; echo $?'}
+1
address@hidden example
+
 @item _
 Many shells reserve @samp{$_} for various purposes, e.g., the name of
 the last command executed.
@@ -15850,6 +15864,7 @@ Limitations of Builtins
 item @samp{$@@}, for more.


address@hidden
 @item @command{if}
 @c ---------------
 @prindex @command{if}
-- 
1.6.3.rc3.2.g4b51


reply via email to

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