Re: what does export do?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday, May 20th 2005 at 10:52 +0100, quoth THUFIR HAWAT:

=>from the man file:
=>
=>       export [-fn] [name[=word]] ...

This might be more than you want to know, but it seems like you don't have 
a grasp of what your environmnet is to begin with.

Every programming language has the ability to access its environment and 
to set or unset its variables. The environment is copied to all child 
processes through crt0.o which is linked into every executable.

In bash

export foo=bar
echo $foo

in perl

$ENV{foo}='bar';
print $ENV{foo};

In C 

#include <stdlib.h>
    setenv ( "foo", "bar",  1 );
    printf ( "foo = %s\n", getenv ( "foo" ) );

Also, a really great place to start is to read 

man 5 environ

-- 
Time flies like the wind. Fruit flies like a banana. Stranger things have  .0.
happened but none stranger than this. Does your driver's license say Organ ..0
Donor?Black holes are where God divided by zero. Listen to me! We are all- 000
individuals! What if this weren't a hypothetical question?
steveo at syslang.net


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux