On 08/24/2010 11:37 PM, Ralf Wildenhues wrote:
The more aggressive approach is to assume that all shells that
support shell functions also support : in variable substitutions;

I can't really judge this one well.  If Paul doesn't know, Sven
Mascheck's pages are a good indicator.

I think I'll go with the more aggressive patch and assume that : works based on [1]; hopefully enough people with alternate shells run the testsuite and point out any regressions (although such are unlikely to occur); I've already tested some older versions of ash, bash, zsh, posh, dash, yash, ksh, and Solaris /bin/sh.

[1] http://www.in-ulm.de/~mascheck/bourne/
says that System III added ${a:=b} at the same time as [!..] negated globbing, and that functions came later in SVR2.


Should we also update tests/m4sh.at to add a test next
to 'Negated classes in globbing' and 'Functions support'
to reiterate this spy in the autoconf testsuite?

Yes, that would be good.  Thanks!

Some of the comments in the existing tests are out of date, too. I guess that means I need to respin and re-post this patch with all of those fixes.

+_AS_RUN([_AS_SHELL_NULL_WORKS]) || {
+  echo No shell found that supports \${a:-b}.

Please quote {a:-b} otherwise there is the slight chance that the { }
get removed if there is a file named '$a:-b' in the current directory.
Also, output to stderr?

Sure. I was blindly copying from commit 734abde3, which was the last time we had a spy in autoconf code, and used stdout instead of stderr. But since I'm going to go with the more aggressive approach of assuming : works, we won't need the spy after all.

--
Eric Blake   ebl...@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Reply via email to