mikshaw
Group: Members
Posts: 4856
Joined: July 2004 |
|
Posted: Dec. 11 2005,20:03 |
|
First, the script needs to be executable:
Code Sample | chmod +x go.sh | or Code Sample | chmod 755 go.sh |
Second, the script's first line should be the interpreter with which to run the script. Most commonly it would be sh:
Third, if you use "./" at the beginning of a command, this means that the command is found in your current directory. If the script is anywhere other than the directory in which you are at that time, it will not be found.
Fourth, if your script only does one command like that, it may be more convenient to create an alias instead of a script:
Code Sample | alias go="cd /opt" |
-------------- http://www.tldp.org/LDP/intro-linux/html/index.html
|