Yeah..true if name of your shell script ss then you can't execute this script like.
$ ss
it will give error command not found.Because which commands are in your way is decided by the PATH variable.
So if you want to add current directory to the PATH from which you should be able execute shell script( or for a matter of fact any executable).
Then you should edit file..~/.bashrc
and put following lines in it.
PATH=$PATH:$HOME/bin:.
export PATH
and now execute the file .bashrc for the changes to take effect.using:
$ . .bashrc
And Voila..
$ ss
<<<command works>>
But you should know this is considered a bit insecure.So if you are a security freak avoid this.
Main Topics
Browse All Topics





by: brettmjohnsonPosted on 2004-06-19 at 13:09:10ID: 11352350
First, delete the space between # and ! in the "shebang" line:
#!/bin/bash
Then after saving the file, change its file permissions to include execute permissions:
prompt> chmod +x ss
Finally, if the current directory is not in the PATH, you may have to explicitly state
the directory when invoking the script:
prompt> ./ss