ENVIRONMENT settings
C. Unnikrishnan
unniks at notrees.ACA.MCC.COM
Fri Dec 9 10:55:50 AEST 1988
>From article <10551 at swan.ulowell.edu>, by tclark at 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 at mcc.COM ##Arpa Internet
{ihnp4,seismo,ucb-vax,gatech}!cs.utexas.edu!pp!unniks
*********************************************************************
More information about the Comp.unix.questions
mailing list