-   Linux - Newbie (
-   -   how to set path? here a meet the problem with ns2 installation (

cain_eve 12-13-2004 11:36 AM

how to set path? here a meet the problem with ns2 installation
Hi, I just install network simulator 2. The process is so long and at the end It shows something I must do. I think it is like to set a PATH for java in windows. But I don't know how to command.
The screem of final result is as follows,
Please put /usr/local/src/ns-allinone-2.27/bin:/usr/local/src/ns-allinone-2.27/tcl8.4.5/unix:/usr/local/src/ns-allinone-2.27/tk8.4.5/unix
into your PATH environment; so that you'll be able to run itm/tclsh/wish/xgraph.

(1) You MUST put /usr/local/src/ns-allinone-2.27/otcl-1.8, /usr/local/src/ns-allinone-2.27/lib,
into your LD_LIBRARY_PATH environment variable.
If it complains about X libraries, add path to your X libraries
If you are using csh, you can set it like:
setenv LD_LIBRARY_PATH <paths>
If you are using sh, you can set it like:
export LD_LIBRARY_PATH=<paths>

(2) You MUST put /usr/local/src/ns-allinone-2.27/tcl8.4.5/library into your TCL_LIBRARY environmental
variable. Otherwise ns/nam will complain during startup.

(3) [OPTIONAL] To save disk space, you can now delete directories tcl8.4.5
and tk8.4.5. They are now installed under /usr/local/src/ns-allinone-2.27/{bin,include,lib}

After these steps, you can now run the ns validation suite with
cd ns-2.27; ./validate

visaris 12-13-2004 11:39 AM

In a generic way, if you want to add somthing to your path you can do this (bash):


export PATH=$PATH:/new/path/to/add/here/
You may want to add a line like that to your ~/.bashrc file so your path will be set up correctly all the time.

cain_eve 12-13-2004 12:38 PM

Thanks visaris
I dont't know what's the meaning of /.bashrc
what is this file useful and where can I find it or just creat a new one under root or the ns2file?


cain_eve 12-13-2004 12:45 PM

by the way, what is and what is the differences of csh and sh?
where is the location of LD_Library_PATH and TCL_LIBRARY?
many thanks

visaris 12-13-2004 12:46 PM

The file '.bashrc' is a file that contains commands which are to be run automatically after bash starts up. For example, if your username is "foo" and you placed


echo 'Welcome to Linux, foo!'
at the end of your /home/foo/.bashrc file, you would be greeted by "Welcome to Linux, foo!" every time you logged in or started a new xterminal.

Once you have your export lines set up correctly, you can place them in your user's ~/.bashrc file, and then everytime you start a new xterm, the required environment variables will be set up for you, and you can then run your ns2 or whatever.

cain_eve 12-13-2004 01:02 PM

seems more clear
so the filename is just .bashrc
when I install a new system there is no such file yet?
as I'm a beginner
I will search for some similar thread.


visaris 12-13-2004 01:03 PM

LD_Library_PATH and TCL_LIBRARY are environment variables just like PATH is. To get a list of all your current variables and their values type in 'env'.

To set a variable to a value do:

export YOUR_VAR_HERE=your_value_here
To add something to the end of a variable do:

export YOUR_VAR_HERE=$YOUR_VAR_HEREyour_value_to_add_here

cain_eve 12-13-2004 01:10 PM

Oh I see
the file is hide?

cain_eve 12-13-2004 01:11 PM

how to see hide file?

visaris 12-13-2004 01:14 PM

Well, the environment variables aren't really stored in a file. At least, I don't think so. They are stored in your shell's memory. Sort of like internal values/settings.

If you're asking about the .bashrc file, that is hidden from the ls output. To find all the '.' files do a "ls -al" and that should list all of them. If you do not have a .bashrc file, you can always make one.

cain_eve 12-13-2004 01:23 PM

Oh I read the ls man file.
Your replies are very important to me. Thanks a lot.

boydasilva 12-16-2004 04:31 PM

Don't mean to hijack here, but is there any way to remove a path once it has been exported in the .bashrc file? I've made a mistake and I don't seem to be able to change it.

cain_eve 12-16-2004 05:09 PM

I think just modify the .bashrc file
vi .bashrc
and remove the export line

All times are GMT -5. The time now is 03:43 AM.