9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Printenv(1)
@ 2004-05-08  8:38 lucio
  2004-05-08 11:32 ` Richard Miller
  0 siblings, 1 reply; 6+ messages in thread
From: lucio @ 2004-05-08  8:38 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 292 bytes --]

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

[-- Attachment #2: printenv.c --]
[-- Type: text/plain, Size: 310 bytes --]

#include	<u.h>
#include	<libc.h>

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;
}

^ permalink raw reply	[flat|nested] 6+ messages in thread
[parent not found: <ee9e417a040508081457f3fe12@mail.gmail.com>]

end of thread, other threads:[~2004-05-12  5:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-08  8:38 [9fans] Printenv(1) lucio
2004-05-08 11:32 ` Richard Miller
     [not found] <ee9e417a040508081457f3fe12@mail.gmail.com>
2004-05-11 18:41 ` rog
2004-05-11 19:06   ` Russ Cox
2004-05-11 19:16     ` rog
2004-05-12  5:18     ` lucio

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).