Hi Teerawat,
 Thank you for following this topic.This is my current .bashrc config:

   NSHOME=~/NS2/ns-allinone-2.35-RC3
   OTCL_LIB=${NSHOME}/otcl-1.14
   NS2_LIB=${NSHOME}/lib
   export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB
   export TCL_LIBRARY=${NSHOME}/tcl8.5.8/library
   PATH=$PATH:${NSHOME}/ns-2.35:${NSHOME}/nam-1.15

 And the following lines show what my problem is, including the information
you asked for.

administra...@parsvictor ~
$ ./ns
bash: ./ns: No such file or directory

administra...@parsvictor ~
$ pwd
/home/Administrator

administra...@parsvictor ~
$ ls
NS2

administra...@parsvictor ~
$ cd NS2

administra...@parsvictor ~/NS2
$ ls
ns-allinone-2.35-RC6  ns-allinone-2.35-RC6.tar.gz

administra...@parsvictor ~/NS2
$ cd ns-allinone-2.35-RC6

administra...@parsvictor ~/NS2/ns-allinone-2.35-RC6
$ ls
INSTALL.WIN32  dei80211mr-1.1.4  lib       otcl-1.14  tclcl
zlib-1.2.3
README         gt-itm            nam-1.15  sgb        tclcl-1.20
bin            include           ns-2.35   share      tk8.5.8
cweb           install           otcl      tcl8.5.8   xgraph-12.2

administra...@parsvictor ~/NS2/ns-allinone-2.35-RC6
$ cd ns-2.35

administra...@parsvictor ~/NS2/ns-allinone-2.35-RC6/ns-2.35
$ ./ns
% puts "Hello World!"
Hello World!
%

administra...@parsvictor ~/NS2/ns-allinone-2.35-RC6/ns-2.35
$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/cygdrive/c/Tcl/bin:/cygdrive/c/Windows/system32:/c
ygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/home/Administrator/NS2/ns-a
/nam-1.15/home/Administrator/NS2/ns-allinone-2.35-RC3

 It's clear that there is a missing delimiter between the last two paths in
" echo $PATH " response.I though it might be because of ${NSHOME} and it was
cause when I replaced " ${NSHOME}/ns-2.35:${NSHOME}/nam-1.15 " with "
~/NS2/ns-allinone-2.35-RC3/ns-2.35:~/NS2/ns-allinone-2.35-RC3/nam-1.15 " the
response to echo $PATH have changed this way:

   administra...@parsvictor ~
   $ echo $PATH

/usr/local/bin:/usr/bin:/bin:/cygdrive/c/Tcl/bin:/cygdrive/c/Windows/system32:/c

ygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/home/Administrator/NS2/ns-a

llinone-2.35-RC3/ns-2.35:/home/Administrator/NS2/ns-allinone-2.35-RC3/nam-1.15

 Now at least the path to NAM seems to be correct but I still can't access
NS and NAM outside their directories.any suggestion?

 Thanks,
 Mobin


On Tue, Sep 7, 2010 at 9:17 PM, Teerawat Issariyakul <teera...@ece.ubc.ca>wrote:

>
> Hi Mobin,
>
> Please give me the following information for your setting:
>
> 1. What is {NSHOME}?
> 2. What is the full path of you NS2 installation (type pwd at your
> running directory)
>
> You may look at how to configure your shell by looking at
>
>
> http://www.ns2ultimate.com/post/504833450/linux-initialization-files-bash-profile-and-bashrc
>
>
>
> Best Regards,
>
> Teerawat Issariyakul
> http://www.ns2ultimate.com/
> http://www.facebook.com/pages/Teerawat-Issariyakul/358240861417
> http://twitter.com/T_Bear
> http://www.t-issariyakul.blogspot.com
> http://www.ece.ubc.ca/~teerawat <http://www.ece.ubc.ca/%7Eteerawat>
>
>
>
>
>
> On 9/7/2010, "Mobin Yazarlou" <yazarlo...@gmail.com> wrote:
>
> >Hi,
> > Thank you all for helping me to solve this problem.The reason for getting
> >"bash: ns: command not found" error was trying to run NS by typing "ns",
> not
> >"./ns".
> > Now I can use NS and also NAM by going to their directories in Cygwin
> >prompt which is a little bit hard, especially for those who categorize
> their
> >projects in different directories.I have added both NS and NAM directories
> >to my PATH (in .bashrc) correctly but the response to echo $PATH differs
> >from what i defined in .bashrc.
> > When the PATH is " PATH=$PATH:${NSHOME}/ns-2.35:${NSHOME}/nam-1.15 " I
> get
> >the following response in the answer to echo $PATH
> >
> >mo...@mobin ~
> >$ echo $PATH
> >/usr/local/bin:/usr/bin:/bin:/cygdrive/c/Program Files/PC Connectivity
> >Solution/
>
> >:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/W
> >bem:/cygdrive/c/Program Files/Intel/WiFi/bin/:/cygdrive/c/Program
> >Files/Microsof
> >t SQL Server/90/Tools/binn/:/cygdrive/c/php5:/cygdrive/c/Program
> >Files/MySQL/MyS
> >/nam-1.15/home/Mobin/ns-allinone-2.35-RC6-2.35-RC6
> >
> > To simplify PATH for debugging I removed $PATH in PATH and changed it
> this
> >way:
> >  PATH=${NSHOME}/ns-2.35:${NSHOME}/nam-1.15
> > and with this value for PATH environment variable, echo $PATH prints
> this:
> >
> >mo...@mobin ~
> >$ echo $PATH
> >/nam-1.15/home/Mobin/ns-allinone-2.35-RC6
> >
> > Which doesn't sounds correct to me.do you have any idea about this?
> >
> > Thanks,
> > Mobin
> >
> >
> >On Mon, Sep 6, 2010 at 5:52 PM, Tom Henderson <t...@tomh.org> wrote:
> >
> >> On 9/6/10 9:54 AM, Mobin Yazarlou wrote:
> >>
> >>>
> >>> Hi Gang,
> >>>  Thanks for your answer.I found that those warnings were because of the
> >>> following two lines in .bashrc file:
> >>>
> >>> unset TMP
> >>> unset TEMP
> >>>
> >>>  Removing these two directions eliminates warnings.
> >>>
> >>>  After removing all comments and the mentioned directions from .bashrc,
> I
> >>> changed the environment variables this way (thanks T. Issaraiyakul for
> his
> >>> helpful Slides on NS installation):
> >>>
> >>> NSHOME=~/ns-allinone-2.35-RC6
> >>> OTCL_LIB=${NSHOME}/otcl-1.14
> >>> NS2_LIB=${NSHOME}/lib
> >>> export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB
> >>> export TCL_LIBRARY=${NSHOME}/tcl8.5.8/library
> >>> PATH=$PATH:${NSHOME}/ns-2.35:${NSHOME}/nam-1.15
> >>>
> >>>  And now the response to 'ns' command in Cygwin prompt is as follows:
> >>>
> >>> mo...@mobin ~
> >>> $ ns
> >>> bash: ns: command not found
> >>>
> >>>  I don't know why this happens but I'm pretty sure that 'ns.exe' exists
> in
> >>> 'ns-2.35' folder, which is declared in PATH.
> >>>
> >>>  Is there any suggestion to overcome this problem?
> >>>
> >>>  Thanks,
> >>>  Mobin
> >>>
> >>
> >>
> >>
> >> Can you try this?
> >>
> >> cd ${NSHOME}/ns-2.35
> >> ./ns
> >>
> >> Can you try
> >> echo $PATH
> >> and see if ns is in your path?
> >>
> >> - Tom
> >>
> >> - Tom
> >>
> >
> >
> >
> >
> >On Mon, Sep 6, 2010 at 6:40 PM, Teerawat Issariyakul <teera...@ece.ubc.ca
> >wrote:
> >
> >>
> >> Hi,
> >>
> >> Which directory are you executing ns.exe?
> >>
> >> Can you try to go to ns2 directory and do it again?
> >>
> >> Best Regards,
> >>
> >> Teerawat Issariyakul
> >> http://www.ns2ultimate.com/
> >> http://www.facebook.com/pages/Teerawat-Issariyakul/358240861417
> >> http://twitter.com/T_Bear
> >> http://www.t-issariyakul.blogspot.com
> >> http://www.ece.ubc.ca/~teerawat <http://www.ece.ubc.ca/%7Eteerawat> <
> http://www.ece.ubc.ca/%7Eteerawat>
> >>
> >>
> >>
> >>
> >> On 9/6/2010, "Mobin Yazarlou" <yazarlo...@gmail.com> wrote:
> >>
> >> >
> >> >Hello,
> >> > I've installed "ns-allinone-2.35-RC6" on the latest version of Cygwin
> >> (1.7)
> >> >in WinXP twice but I still get the following error
> >> >when I try to run NS2 by typing "ns" in cygwin prompt.
> >> >
> >> >mo...@mobin ~
> >> >$ ns
> >> >/home/Mobin/ns-allinone-2.35-RC6/ns-2.35/ns.exe: error while loading
> >> shared
> >> >libr
> >> >aries: ?: cannot open shared object file: No such file or directory
> >> >
> >> >
> >> > The three lines that i've added to .bashrc are these:
> >> >
> >> >export
> >>
> >>
> >LD_LIBRARY_PATH=/home/Mobin/ns-allinone-2.35-RC6/otcl-1.14:/home/Mobin/ns-allinone-2.35-RC6/lib
> >> >export TCL_LIBRARY=/home/Mobin/ns-allinone-2.35-RC6/tcl8.5.8/library
> >>
> >>
> >PATH=/home/Mobin/ns-allinone-2.35-RC6/bin:/home/Mobin/ns-allinone-2.35-RC6/tcl8.5.8/unix:/home/Mobin/ns-allinone-2.35-RC6/tk8.5.8/unix
> >> >
> >> > And another important thing to mention is the following warnings which
> >> >appear right after opening Cygwin prompt.
> >> >
> >> > ': not a valid identifier
> >> > ': not a valid identifier
> >> >
> >> > mo...@mobin ~
> >> > $
> >> >
> >> > Could anyone help me to fix this problem?
> >> >
> >> > Thanks,
> >> > Mobin
> >> >
> >>
>

Reply via email to