Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!cs.utexas.edu!pp!notrees!unniks From: unniks@notrees.ACA.MCC.COM (C. Unnikrishnan) Newsgroups: comp.unix.questions Subject: Re: ENVIRONMENT settings Message-ID: <76@notrees.ACA.MCC.COM> Date: 9 Dec 88 00:55:50 GMT References: <10551@swan.ulowell.edu> Organization: MCC, Austin, TX Lines: 26 From article <10551@swan.ulowell.edu>, by tclark@hawk.ulowell.edu (T.C. Clark): > > I'm writing a C program in which I would like to read in > some of the user's ENVIRONMENT settings (ie. logname, printer) > Can someone give me an idea on how to read these in and use > them? here's a portion of the code pulled out from a source file main (argc, argv, envp) register int argc; register char **argv; char **envp; { /* do something */ for (; *envp; envp++) { printf("%s\n", *envp); } /* do whatever with the variables */ } ********************************************************************* C. Unni Krishnan unni@mcc.COM ##Arpa Internet {ihnp4,seismo,ucb-vax,gatech}!cs.utexas.edu!pp!unniks *********************************************************************