autoconf-patches
[Top][All Lists]
Advanced

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

Documentation for ash-0.2 quirks


From: Pavel Roskin
Subject: Documentation for ash-0.2 quirks
Date: Thu, 19 Oct 2000 13:55:49 -0400 (EDT)

Hello!

As promised:

________________________________
Index: ChangeLog
--- ChangeLog   Thu Oct 19 09:08:51 2000
+++ ChangeLog   Thu Oct 19 13:52:31 2000
@@ -0,0 +1,4 @@
+2000-10-19  Pavel Roskin  <address@hidden>
+
+       * doc/autoconf.texi (Shellology): Documented quirks in ash-0.2.
+
Index: doc/autoconf.texi
--- doc/autoconf.texi   Wed Oct 18 17:34:39 2000
+++ doc/autoconf.texi   Thu Oct 19 13:44:39 2000
@@ -4971,6 +4971,55 @@
 compatible with the Bourne shell: you have to run @samp{emulate sh} and
 set @code{NULLCMD} to @samp{:}. @xref{Compatibility,, Compatibility,
 zsh, The Z Shell Manual}, for details.
+
address@hidden @command{ash}
address@hidden @command{ash}
address@hidden is often used on @sc{gnu}/Linux and @sc{bsd} systems as a
+light-weight Bourne-compatible shell.  @command{ash} version 0.2 has
+some bugs that are fixed in the 0.3.x series, but portable shell scripts
+should workaround them, since version 0.2 is still shipped with many
address@hidden/Linux distributions.
+
+To be compatible with @command{ash} 0.2
+
address@hidden @bullet
address@hidden
+don't rely on variable assignment setting @samp{$?} unless the
+assignment involves command substitution:
+
address@hidden
+false || foo=bar && echo "Not portable"
+false || foo=`bar` && echo "Portable"
address@hidden example
+
address@hidden
+don't use @samp{$?} after expanding empty or unset variables:
+
address@hidden
+foo=
+false
+$foo
+echo "Don't use it: $?"
address@hidden example
+
address@hidden
+don't use command substitution within variable expansion:
+
address@hidden
+echo address@hidden@}
address@hidden example
+
address@hidden
+beware that @command{exit} inside command substitution causes the
+current shell exit as well. Use parentheses to prevent @command{ash}
+from exiting:
+
address@hidden
+(`exit 1`) || echo "All right"
+`exit 1` || echo "ash won't print it"
address@hidden example
+
address@hidden itemize
 @end table
 
 
________________________________

Regards,
Pavel Roskin




reply via email to

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