So I just started learning UNIX and need a very basic question answered! I have spent hours searching for the correct way, but it seems I cant really get my head around it!
I have script called "contactdetails". I would like to run it by just typing in "contactdetails" in any directory, but the only way I can run it is by typing in "sh contactdetails".
Now I've heard I should add "#!/bin/sh" to the top line of my script, yet that has not worked. I have also been told I need to add it the $PATH environmental variable. I don't really understand what that means, and I when I type "echo $PATH" I get "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games".
When I try to create a directory/file in the "/usr" directory, I get the message "Permission Denied". I logging onto UNIX via my works server, so is that the problem? Is there a way for me to run the script by just typing its name as opposed to sh itsname?
Thanks in advance!
edit: I have also changed permissions to executable (chmod 755 contactdetails) if thats of any relevance! And i'm using PuTTY!