GNU bug report logs - #18612
non-portable shell substitution in configure.ac

Previous Next

Package: emacs;

Reported by: Assaf Gordon <assafgordon <at> gmail.com>

Date: Thu, 2 Oct 2014 19:23:01 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Assaf Gordon <assafgordon <at> gmail.com>
To: Dani Moncayo <dmoncayo <at> gmail.com>, Glenn Morris <rgm <at> gnu.org>
Cc: 18612 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: bug#18612: [platform-testers] Emacs pretest 24.3.94
Date: Thu, 02 Oct 2014 18:06:17 -0400
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.