Find the answer to your Linux question:
Results 1 to 3 of 3
Hi, I need to have an environment variable global for all the shells. So I am doing this- $ MY_VAR='some value' $ export MY_VAR now if i close the current ...
  1. #1
    Just Joined! asadujjaman's Avatar
    Join Date
    Apr 2007
    Location
    ~
    Posts
    51

    'export' does not work in FC7?

    Hi, I need to have an environment variable global for all the shells. So I am doing this-

    $ MY_VAR='some value'
    $ export MY_VAR

    now if i close the current terminal and open up another and type-

    $ echo $MY_VAR

    just a blank line prints. So, export doesn't work? I am using FC7. Is it a bug then?
    What to do..?

  2. #2
    Blackfooted Penguin daark.child's Avatar
    Join Date
    Apr 2006
    Location
    West Yorks
    Posts
    4,344
    export is working as it should. If you want the variable to be permanent, then put your export statement it in /etc/profile, ~/.profile or ~/.bash_profile.

  3. #3
    scm
    scm is offline
    Linux Engineer
    Join Date
    Feb 2005
    Posts
    1,044
    export tells the shell that the variable is to be inherited by all subprocesses. The exported variable disappears when the shell it's set in is terminated.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...