[Discuss] awk linux and ENVIRON

Alan W. Irwin irwin at beluga.phys.uvic.ca
Fri Jun 23 10:52:11 PDT 2006


Out of curiosity I played around with this a bit, and the following two awk
scripts produce lots of output on my Debian stable system.

awk "END{for(env in ENVIRON) print env}" </dev/null |less
awk "END{for(env in ENVIRON) print ENVIRON[env]}" </dev/null |less

Thus, it appears ENVIRON is working perfectly on that platform.

Side note: I would think

awk "END{for(env in ENVIRON) print env, " = ", ENVIRON[env]}" </dev/null |less

would also work to combine the two above results in an easily understood
format, but it doesn't work due to some syntax error which I don't
understand since it has been years since I used awk.  Can you tell me what
is wrong with that combined test script, Peter?

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the Yorick front-end to PLplot (yplot.sf.net); the
Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the Discuss mailing list