autoconf-patches
[Top][All Lists]
Advanced

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

Re: grep-2.9.69-f91c on OSF/1


From: Eric Blake
Subject: Re: grep-2.9.69-f91c on OSF/1
Date: Fri, 11 Nov 2011 13:51:28 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110930 Thunderbird/7.0.1

[adding autoconf]

On 11/11/2011 01:38 PM, Bruno Haible wrote:

> The syntax "export VAR=VALUE" is not guaranteed by this shell.
> Either write "env VAR=VALUE ...", or "VAR=VALUE; export VAR; ..."

> 
> Strangely enough, this portability problem of the 'export' built-in
> is well-known, but not mentioned in the Autoconf manual
> <http://www.gnu.org/software/autoconf/manual/html_node/Limitations-of-Builtins.html>.

Hmm, I could have sworn it was in there, but you appear to be right.
I'll be committing this soon.

diff --git i/ChangeLog w/ChangeLog
index e51f7d7..72b1dbc 100644
--- i/ChangeLog
+++ w/ChangeLog
@@ -1,3 +1,10 @@
+2011-11-11  Eric Blake  <address@hidden>
+
+       doc: mention export portability hint
+       * doc/autoconf.texi (Limitations of Builtins) <export>: Document
+       export limitation.
+       Suggested by Bruno Haible.
+
 2011-10-21  Stefano Lattarini  <address@hidden>

        fortran: define $GFC to "yes" if $FC is a GNU compiler
diff --git i/doc/autoconf.texi w/doc/autoconf.texi
index b6dc67b..417c432 100644
--- i/doc/autoconf.texi
+++ w/doc/autoconf.texi
@@ -17642,6 +17642,20 @@ Limitations of Builtins
 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).
+
address@hidden
+$ @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
address@hidden example
+
 @item @command{false}
 @c ------------------
 @prindex @command{false}


-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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