[Top][All Lists]
[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 14:18:40 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110930 Thunderbird/7.0.1 |
[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).
>> +
>> 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
>> +
>>
> 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 <address@hidden>
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 <address@hidden>
---
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 <address@hidden>
+ 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 address@hidden +1-801-349-2682
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature