I am trying to execute a TCL script in NS2 simulator but I see this error:

bash: ./ns: No such file or directory

The path is `ns-2.35/tcl/ex/wpan.' When I execute this file in ns-2.35, it runs well.

How can I fix this?


The path isn't what you think it is.

If you don't specify the path, the system will search for your executable using the PATH environment variable, not in your current directory.

Use ./ before your executable name and that will work.

./ means "This directory", just like ../ means "the parent directory"

  • thanks for your answer i went to that directory by "cd" command then i execute that file by "./ns sample.tcl" but it still say the same error note: it works in ns-2.35 but when its in a directiry it doesnt work – eli Sep 8 '16 at 5:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.