setting Environment variables?
hii all, I'm very new to Linux & I'm using fedora7 for ns2, after installation i export the Environment variables this way:
>export PATH=/root/ns-allinone-2.31/bin:/root/ns-allinone-2.31/tcl8.4.14/ unix:/root/ns-allinone-2.31/tk8.4.14/unix >export LD_LIBRARY_PATH= /root/ns-allinone-2.31/otcl-1.13:/root/ns-allinone-2.31/lib > export TCL_LIBRARY=/root/ns-allinone-2.31/tcl8.4.14/library but I when i check the environment variables using "env". i dont see my new variables!! please how can i solve this problem? what im doing wrong? Thank You Muby |
use "echo" for example to see your new PATH:
Code:
# echo $PATH Code:
# env | grep PATH HTH, |
Hi Muby,
I think that the problem comes from the fact you override the PATH environment variable. As a result, when you try to use 'env' command, the shell does not know where it is. You should try like this: Code:
export PATH=${PATH}:/root/ns-allinone-2.31/bin:/root/ns-allinone-2.31/tcl8.4.14/unix:/root/ns-allinone-2.31/tk8.4.14/unix HTH, |
Furthermore, take in mind that if you export a variable from the command line, it will be available to the open shell only (that is if you open another terminal you start a new shell which will not be aware of the modified environment). To make your changes really global, you have to put the export statement in a file which will be sourced every time you start a new shell (usually .bashrc if using bash).
|
colucix, lbdgwgt & kWzTa Thank you guys you were helpfull, but i found that my setting are not global. which bashrc file i should modify with export statement? & what line should change?
[root@localhost ~]# locate bashrc /etc/bashrc /etc/skel/.bashrc /home/Mubarak/.bashrc /root/.bashrc /usr/share/doc/bash-3.2/startup-files/bashrc statement Thanks again guys |
If you want to define environment variables on a per-user basis, you should put export statements in .bashrc under user's home (e.g. /home/Mubarak/.bashrc from your list). If you want a system wide configuration, the better place is under the /etc/profile.d directory. Look at its content: you will find some .sh and .csh scripts. These contain environment settings from specific applications. You can create your own, for example a script called ns.sh.
Just for completeness, these scripts are sourced from /etc/profile, which - on my system - has the following relevant piece of code: Code:
for i in /etc/profile.d/*.sh ; do |
All times are GMT -5. The time now is 04:55 PM. |