LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (http://www.linuxquestions.org/questions/fedora-35/)
-   -   Setting and getting environment variables??? (http://www.linuxquestions.org/questions/fedora-35/setting-and-getting-environment-variables-510074/)

Sulman Shah 12-13-2006 11:59 AM

Setting and getting environment variables???
 
Dear All,

I am new to linux and just want to know that how many different types of environment variables are there in linux. How do we set and get their values? How will we the environment path of a library to a different one? i mean to say how can we change it?

--Kind regards,
Sulman

fordeck 12-13-2006 12:17 PM

You can for example use:

Code:

printenv
Will print the environment variables

Code:

export VARNAME=varvalue
Can be used to set an environment variable

chrism01 12-13-2006 07:33 PM

Other cmds are:
set
env
both will show env vars.
Incidentally, 'export' is only required if you want the value to be passed down to sub-shells of the assigning shell.
Otherwise, simple assignment is sufficient.


All times are GMT -5. The time now is 02:09 PM.