I am trying to run a shell script with the bellow content
ns script.tcl sleep 100
ns works fine when typing in terminal but says:
ns : not found
when runing from the shell script.
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
#!/bin/bash ns script.tcl sleep 100
What happens if you try running the script with a proper interpreter declaration at the top? This could possibly load your $PATH, which is how your terminal knows where to find
If that doesn't work, you could try the following:
#!/bin/bash /usr/bin/ns script.tcl sleep 100
You should probably point to the path/directory in which your script.tcl is in. If it's in the same directory as the bash script, then you'd be fine. But what would happen if your CWD had script.tcl? It's best to be specific when scripting. I was able to tell where
ns was located by running
which ns in my terminal.