I have a shell script which I want to run without using the "sh" or "bash" commands. For example:
Instead of: sh script.sh
I want to use: script.sh
How can I do this?
P.S. (i) I don't use shell script much and I tried reading about aliases, but I did not understand how to use them.
(ii) I also read about linking the script with another file in the PATH variables. I am using my university server and I don't have permissions to create a file in those locations.
$HOME/bin
- if you don't already have one, add it to your PATH (near the front). Put the scripts (and any other programs) you want to execute directly without specify the pathname in here, or symlinks in here to where the actual programs are.mv example.sh example
and thenexample
should work on its own.