On 09/07/2010 03:05 PM, Ralf Wildenhues wrote:
[ let's drop at least bug-standards ]
* Eric Blake wrote on Tue, Sep 07, 2010 at 10:38:52PM CEST:
More precisely, does AC_PROG_AWK guarantee us an awk that will
understand ENVIRON?
I think so, yes.
After further testing, I'm starting to think so as well. AC_PROG_AWK is
indeed documented as favoring [gmn]awk over the traditional version. I
found that IRIX 5.3 has a deficient traditional awk, but does have a
working /usr/bin/nawk:
$ uname -a
IRIX xxx 5.3 11091812 IP22 mips unknown Irix
$ foo=bar /bin/awk 'BEGIN { print ENVIRON["foo"] }' </dev/null
$ foo=bar nawk 'BEGIN { print ENVIRON["foo"] }' </dev/null
bar
$
I also tested Solaris, AIX 4.3.3, FreeBSD, and Darwin, so I've covered a
decent smattering of systems where [mn]awk is not likely to be GNU awk.
--
Eric Blake ebl...@redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org