]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
doc: mention export portability hint
authorEric Blake <eblake@redhat.com>
Fri, 11 Nov 2011 20:51:33 +0000 (13:51 -0700)
committerEric Blake <eblake@redhat.com>
Fri, 11 Nov 2011 20:51:33 +0000 (13:51 -0700)
* doc/autoconf.texi (Limitations of Builtins) <export>: Document
export limitation.
Suggested by Bruno Haible.

Signed-off-by: Eric Blake <eblake@redhat.com>
ChangeLog
doc/autoconf.texi

index e51f7d7434e63547cdd68786878246942fadb084..72b1dbccf8ad67badacc42ce34eb809a955b4ea1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-11-11  Eric Blake  <eblake@redhat.com>
+
+       doc: mention export portability hint
+       * doc/autoconf.texi (Limitations of Builtins) <export>: Document
+       export limitation.
+       Suggested by Bruno Haible.
+
 2011-10-21  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        fortran: define $GFC to "yes" if $FC is a GNU compiler
index b6dc67b846739c0e58b410ed536b18504b811415..417c432db9b30de835ef78584d077f730a4c4ea6 100644 (file)
@@ -17642,6 +17642,20 @@ $ @kbd{ash -c 'export foo; env | grep foo'}
 foo=
 @end example
 
+Posix requires @command{export} to honor assignments made as arguments,
+but older shells did not support this.  Portable scripts should separate
+assignments and exports into different statements (it does not matter if
+the export comes before or after the assignment).
+
+@example
+$ @kbd{bash -c 'export foo=bar; echo $foo'}
+bar
+$ @kbd{/bin/sh -c 'export foo=bar; echo $foo'}
+/bin/sh: foo=bar: is not an identifier
+$ @kbd{/bin/sh -c 'export foo; foo=bar; echo $foo'}
+bar
+@end example
+
 @item @command{false}
 @c ------------------
 @prindex @command{false}