[dropping grep]
On 11/11/2011 02:05 PM, Stefano Lattarini wrote:
>> +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
>> +
>>
> I think it would be worth mentioning explicitly some shells that behave like
> this (Solaris 10 /bin/sh does, for example). For a rationale about why this
> should be useful, see:
> <http://lists.gnu.org/archive/html/autoconf-patches/2011-08/msg00007.html>Oh, good reminder. Alas, I already pushed, so this will be a separate commit, but better late than never. Also, in re-reading the section, I now see that we already had a paragraph a few lines earlier mentioning that the export can come in either order, so I'll delete the redundant parenthetical. From 1c7895992419779bc8922349d2c62385b10b1fd6 Mon Sep 17 00:00:00 2001 From: Eric Blake <[email protected]> Date: Fri, 11 Nov 2011 14:16:35 -0700 Subject: [PATCH] doc: tweak previous commit * doc/autoconf.texi (Limitations of Builtins) <export>: Give concrete example of offender, and drop redundant text. Reported by Stefano Lattarini. Signed-off-by: Eric Blake <[email protected]> --- ChangeLog | 7 +++++++ doc/autoconf.texi | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 72b1dbc..0c23239 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2011-11-11 Eric Blake <[email protected]> + doc: tweak previous commit + * doc/autoconf.texi (Limitations of Builtins) <export>: Give + concrete example of offender, and drop redundant text. + Reported by Stefano Lattarini. + doc: mention export portability hint * doc/autoconf.texi (Limitations of Builtins) <export>: Document export limitation. diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 417c432..c5b180c 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -17643,9 +17643,9 @@ Limitations of Builtins @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). +but older shells do not support this, including @command{/bin/sh} in +Solaris 10. Portable scripts should separate assignments and exports +into different statements. @example $ @kbd{bash -c 'export foo=bar; echo $foo'} -- 1.7.7.1 -- Eric Blake [email protected] +1-801-349-2682 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
