home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.programmer
- Path: sparky!uunet!math.fu-berlin.de!tati.chemie.fu-berlin.de!melchers
- From: melchers@chemie.fu-berlin.de (Bernd Melchers)
- Subject: Re: C's getenv() with UNIX
- Message-ID: <8TZ0PAP@math.fu-berlin.de>
- Sender: news@math.fu-berlin.de (Math Department)
- Organization: Free University of Berlin, Germany
- References: <93019.001932BAB127@psuvm.psu.edu> <1jgh3eINNa0m@early-bird.think.com>
- Date: Thu, 21 Jan 1993 17:30:13 GMT
- Lines: 32
-
- barmar@think.com (Barry Margolin) writes:
-
- >In article <93019.001932BAB127@psuvm.psu.edu> bab <BAB127@psuvm.psu.edu> writes:
- >> Can anyone tell me how to use the getenv() function with UNIX's
- >>environment variables? For example I tried:
- >>getenv( "cwd" )
-
- >There is no "cwd" environment variable. The C shell has a "PWD"
- >environment variable, and a "cwd" shell variable. Shell variables (the
- >kind you set with "set" in C shell, and which you get by *not* exporting a
- >variable in Bourne shell) are local to that shell, not in the environment
- >that's inherited by new processes.
-
- to determine the current working directory, use
- char *getcwd (char *buf, int size);
- because there is no need, that PWD is the current work. dir.
- (just print
- setenv PWD i_am_an_foo___grmmmbl4711
- )
-
- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- Bernd Melchers | melchers@chemie.fu-berlin.de
- Freie Universitaet Berlin | Lieblingsessen: Pizza, aber nur
- Institut fuer Kristallographie | selbstgemachte...
- Takustr. 6 | und ohne Tierkadaver
- D 1000 Berlin 33 |
- Earth |
- Tel.: 0049-30-8383612 |
- |
- Please replace battery pack, attach external power,
- or system will be shutdown in 10 seconds.
- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-