Posted By: Anonymous
I have a shell script which I want to run without using the “sh” or “bash” commands. For example:
I want to use:
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.
Add a “shebang” at the top of your file:
And make your file executable (
chmod +x script.sh).
Finally, modify your path to add the directory where your script is located:
(typically, you want
$HOME/bin for storing your own scripts)