Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!xanth!nic.MR.NET!umn-d-ub!rutgers!cmcl2!phri!marob!daveh From: daveh@marob.MASA.COM (Dave Hammond) Newsgroups: comp.unix.questions Subject: Re: ENV settings Message-ID: <419@marob.MASA.COM> Date: 15 Dec 88 05:12:50 GMT References: <10447@swan.ulowell.edu> Reply-To: daveh@marob.masa.com (Dave Hammond) Organization: ESCC New York City Lines: 16 In article <10447@swan.ulowell.edu> tclark@hawk.ulowell.edu writes: > > I'm writing a C program in which I would like to > use some of the settings in the user's ENVIRONMENT > (i.e. PRINTER, LOGNAME, etc...). > > Could someone tell me how to read these into a string? The getenv() function returns the string value of an environ parameter, e.g.: char *getenv(), *p; if ((p = getenv("LOGNAME"))) printf("Your LOGNAME is %s\n", p); -- Dave Hammond ...!uunet!masa.com!{marob,dsix2}!daveh