I was wondering if it is possible to make a “link” in usr/bin (i.e.) that leads to a shell-script.
But I want just to write
% shellscript
instead of
% sh shellscript.sh
kinda like an alias.
Is this possible?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Make the first line of the script
Then make it executable by typing the command:
If you now place the script in a
binfolder that is on your system’s PATH variable and you will be able to run it directly. To see the folders in your path, type:I usually use
/home/[my username]/binfor scripts that I have written so that they don’t interfere with other users on the system. If I want them to be for all users, I use/usr/local/binwhich is supplied empty on most distributions.The
.shon the end of the script’s filename is only a convention to help you remember what kind of file it is. It will still work if you rename it to justshellscript, for example, which will complete your requirements.