Wednesday, September 15, 2010

Update on NS 2.35 Installation: Command not Found

During the last week, I have got few email about my previous NS2 installation.

The Error Message

After the installation some one type "ns" and get the following error
>>nsbash: ns: command not found
This could be because you have not set the $PATH variable. Therefore, the OS does not know where to look for the command "ns".



Has NS2 Been Installed Correctly?
Here is what you have to do
  1. Go to your directory ns2
  2. If you type "ls", you should see the file "ns.exe"
  3. Type "./ns".
  4. NS2 should run correctly.
What If I Want to Run NS2 in Different Directory

Well, you will have to make the command "ns" globally available. There are two way to achieve this
  1. Set the $PATH variable in the file .bashrc located in your home directory (See the slide and the previous post)
  2. Create a symbolic link to the OS search path such as "/usr/local/bin". To do this, type the followings:
>>cd /usr/local/bin
>>ln –s /home/T_Bear/ns-allinone-2.35-RC3/ns-2.35/ns.exe

This statement works for my system. You might have to adjust the directory accordingly.
Note: "ln -s" is a command which creates a symbolic link to the following input argument to the current directory [see here for more detail]
NS2 should run now correctly.
NS 2.35 Installation Slides
I updated the slide accordingly. Please have a look below:

Ns-2.35 Installation

View more presentations from Teerawat Issariyakul.

No comments: