[Top][All Lists]

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

Re: ./init.sh: line 139: `test-acos': not a valid identifier

From: Ralf Wildenhues
Subject: Re: ./init.sh: line 139: `test-acos': not a valid identifier
Date: Thu, 18 Feb 2010 21:19:35 +0100
User-agent: Mutt/1.5.20 (2009-10-28)


* Eric Blake wrote on Thu, Feb 18, 2010 at 03:48:15PM CET:
> According to Eric Blake on 2/18/2010 6:39 AM:
> > For that matter, we should also try 'set +o posix' prior to looking for a
> > better shell; it is certainly faster, and works for bash:
> > 
> > $ /bin/sh -c 'a-b() { echo hi; }; a-b'
> > /bin/sh: `a-b': not a valid identifier
> > $ /bin/sh -c 'set +o posix; a-b() { echo hi; }; a-b'
> > hi
> For that matter, with bash, we should use:
> $ /bin/sh -c 'set +o posix; a-b() { echo hi; }; set -o posix; a-b'
> hi
> so that the rest of the script avoids any other bash extensions
> incompatible with POSIX (does it strike you odd that bash lets you invoke
> a function with an incompatible name, even though it won't let you define
> it?).

Given that bash may change this particular "feature" at any time without
prior notice, this doesn't seem too safe to rely on.

alias names are typically more relaxed, POSIX does not guarantee hyphens
but dash, /bin/sh -> bash support them, Solaris sh doesn't but its ksh

Since I'd prefer standards-conforming code (FWIW): I volunteer to write
a patch to add $EXEEXT to all test invocations in gnulib testsuite
scripts and makefile sniplets now, and to try to revisit once every 6
months, to please wine setups.  If the gnulib authors can agree to that
strategy, that is, of course.


reply via email to

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