[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: setenv
Well, just a note, in sh-like shells (such as GNU bash) you simply use the "VAR=VALUE" command.For example, to assign the value "Hello" to the environment variable MYVAR type the following line:
MYVAR=Hello
One of the big differences between csh (C-Shell) and sh (Bourne shell) like shells is that sh uses the environment variables as program variables, while csh keeps its own separate set of variables (which are set by "SET VAR=VAL"). However, in order to pass values to a child shell script I think one needs to use the setenv/getenv syntax.
BTW, I always wondered if it's possible to write a program or a script that will set one of the environment variables in the parent process (i.e. the shell that executes it). Since I now realize that all the shells use built-in commands in order to modify the environment variables, maybe it isn't possible as I thought.
Shlomi Fish
Follow-Ups:
- Re: setenv
- From: Eliyahu Skoczylas <eliyahu@photonet.com>