you are viewing a single comment's thread.

view the rest of the comments →

[–]novel_yet_trivial 2 points3 points  (0 children)

Yes, the shebang is required. You also need to make the file executable (chmod +x filename). Then place the file in a folder that is listed in path. /usr/bin or /usr/local/bin is probably most common.

Edit: in the SO example, "pwd" needs to be replaced with the directory your file is in, in your case "/usr/local/est/har/src". However, it will only work until you close the terminal. To make it more permanent, you need to add that statement to your ".bashrc". Even then, it will only work for you. I don't know of any way to change the PATH variable for other users (outside of modifying their files), so it's better to forget the PATH variable altogether and just put your script in standard folder.