]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* doc/autoconf.texi (Shellology): Documented quirks in ash-0.2.
authorPavel Roskin <proski@gnu.org>
Thu, 19 Oct 2000 21:30:29 +0000 (21:30 +0000)
committerPavel Roskin <proski@gnu.org>
Thu, 19 Oct 2000 21:30:29 +0000 (21:30 +0000)
ChangeLog
doc/autoconf.texi

index 451a45c5842ade0404e87bc4cbf88ba41e982b77..7187c0c5f77c2ee038cb936e2e1d64cf0cb56c69 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2000-10-19  Pavel Roskin  <proski@gnu.org>
+
+       * doc/autoconf.texi (Shellology): Documented quirks in ash-0.2.
+
 2000-10-18  Pavel Roskin  <proski@gnu.org>
 
        * mdate-sh: Removed, its copy remains in the doc/ directory.
index df106c3a3fd33ae07f83bf7dd9af196b115dcf4c..b25ab60fe9a1dc40d7acf4cb3145b4d6eddf3870 100644 (file)
@@ -4971,6 +4971,55 @@ To detect whether you are running @command{zsh}, test if
 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.
+
+@item @command{ash}
+@cindex @command{ash}
+@command{ash} 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
+@sc{gnu}/Linux distributions.
+
+To be compatible with @command{ash} 0.2
+
+@itemize @bullet
+@item
+don't rely on variable assignment setting @samp{$?} unless the
+assignment involves command substitution:
+
+@example
+false || foo=bar && echo "Not portable"
+false || foo=`bar` && echo "Portable"
+@end example
+
+@item
+don't use @samp{$?} after expanding empty or unset variables:
+
+@example
+foo=
+false
+$foo
+echo "Don't use it: $?"
+@end example
+
+@item
+don't use command substitution within variable expansion:
+
+@example
+echo $@{FOO=`bar`@}
+@end example
+
+@item
+beware that @command{exit} inside command substitution causes the
+current shell exit as well. Use parentheses to prevent @command{ash}
+from exiting:
+
+@example
+(`exit 1`) || echo "All right"
+`exit 1` || echo "ash won't print it"
+@end example
+
+@end itemize
 @end table