GNU bug report logs -
#18612
non-portable shell substitution in configure.ac
Previous Next
Full log
Message #19 received at 18612 <at> debbugs.gnu.org (full text, mbox):
On 10/02/2014 05:07 PM, Dani Moncayo wrote:
> On Thu, Oct 2, 2014 at 10:09 PM, Glenn Morris <rgm <at> gnu.org> wrote:
>>
>> But other platforms may still try to parse (?) those lines, even if they
>> don't execute them. Presumably that explains:
<...>
> To find out if that's the case here, Assaf could run the configure
> script again, with this patch applied:
The patch itself was not enough, because it still contains the offending lines.
However, I think I managed to reduce the case to this:
=== MINIX R3.3.0 ===
$ sh -c 'echo ${a:0:1}'
sh: Syntax error: Bad substitution
$ sh -c 'true && echo ${a:0:1}'
sh: Syntax error: Bad substitution
$ sh -c 'false && echo ${a:0:1}'
sh: Syntax error: Bad substitution
=== Debian 7.6 ===
$ dash -c 'echo ${a:0:1}'
dash: 1: Bad substitution
$ dash -c 'true && echo ${a:0:1}'
dash: 1: Bad substitution
$ dash -c 'false && echo ${a:0:1}'
(no error printed)
=== NetBSD 6.1.4 ====
$ sh -c 'echo ${a:0:1}'
sh: Syntax error: Bad substitution
$ sh -c 'true && echo ${a:0:1}'
sh: Syntax error: Bad substitution
$ sh -c 'false && echo ${a:0:1}'
sh: Syntax error: Bad substitution
but:
$ ksh -c 'echo ${a:0:1}'
ksh: : bad substitution
$ ksh -c 'true && echo ${a:0:1}'
ksh: : bad substitution
$ ksh -c 'false && echo ${a:0:1}'
(no error printed)
====
The "offending" system is MINIX R3.3.0 (which isn't officially supported).
It is supposed to be MINIX kernel + NetBSD user-space,
so I'm not quite sure why "./configure" on NetBSD works while on MINIX it doesn't.
(something to do with re-exec as "ksh" ? though MINIX does have "/bin/ksh" ).
In any case, I think the examples above demonstrate that MINIX's default shell does parse the shell statements regardless of execution or not, unlike 'dash' or 'ksh'.
I don't know if this is POSIX-compliant-behaviour or not.
Regards,
- Assaf
This bug report was last modified 10 years and 291 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.