On Wed, Apr 25, 2001 at 06:32:29AM +1000, David wrote:
> 
> and a dumb extension to this question.. where are they stored?
> 
> On Wed, 25 Apr 2001, Jeff Waugh wrote:
> 
> > <quote who="Craig">
> > 
> > > Simple question, but one I can't find the answer to.
> > > 
> > > How do you set an Enviromental Variable in bash?
> > 
> > export VARIABLE=poo

Well, from the behavior, consider:

$ FOO=foo BAR=bar
$ export BAR
$ echo $FOO $BAR
foo bar
$ bash -c 'echo $FOO $BAR'
bar
$ FOO=`pwd` bash -c 'echo $FOO $BAR'
/home/pmc bar

The prototype of a program's main:
extern int main(int argc, char **argv, char **argp); /* something like that */

glibc's setenv/etc operations work on a variable called '__environ'
(defined in glibc/sysdeps/generic/environ.c), obviously weak aliased
to 'environ'. More info about 'weak' aliases can be found in your
gcc manual, look for the gnu c '__attribute__' extension (or find
out more in your linker docs).

Anyhow,

Paul.


-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug

Reply via email to