Path: utzoo!attcan!uunet!auspex!guy From: guy@auspex.UUCP (Guy Harris) Newsgroups: comp.unix.questions Subject: Re: ENVIRONMENT settings Message-ID: <666@auspex.UUCP> Date: 10 Dec 88 04:40:19 GMT References: <10551@swan.ulowell.edu> <76@notrees.ACA.MCC.COM> Reply-To: guy@auspex.UUCP (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 23 >here's a portion of the code pulled out from a source file > >main (argc, argv, envp) ... > char **envp; >{ > /* do something */ > for (; *envp; envp++) { > printf("%s\n", *envp); ... You pulled it from the wrong source file; this may be something like the "printenv" or "env" commands. If you want to dump the entire environment, you have to do something like that; however, if you just want to look at some *particular* environment variable, it's easier (and quite possibly more portable) to just do something like char *p; extern char *getenv(); p = getenv("LOGNAME"); which will get the value of the environment variable "LOGNAME".