From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <5e7092eca943af584d215efa3a8f1b9c@proxima.alt.za> To: 9fans@cse.psu.edu From: lucio@proxima.alt.za MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-roduibtcfuxrhxslogrotlchpg" Subject: [9fans] Printenv(1) Date: Sat, 8 May 2004 10:38:53 +0200 Topicbox-Message-UUID: 743b8842-eacd-11e9-9e20-41e7f4b1d025 This is a multi-part message in MIME format. --upas-roduibtcfuxrhxslogrotlchpg Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit This makes it possible for me to test (and fix) ENV handling in Tcl. Others may find it useful, I'm sure I should not have reinvented the wheel, but it was quicker than looking up the wheel patent application :-) Add features to taste, I didn't even consult the Unix man pages. ++L --upas-roduibtcfuxrhxslogrotlchpg Content-Disposition: attachment; filename=printenv.c Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit #include #include main (int argc, char **argv) { int fd, x; long nd; Dir *buf; USED(argc); USED(argv); fd = open ("#e", OREAD); nd = dirreadall (fd, &buf); for (x = 0; x < nd; x++) { print ("%s=%s\n", buf[x].name, getenv (buf[x].name)); } exits (0); return 0; } --upas-roduibtcfuxrhxslogrotlchpg--