Great question — answering as the UphillTech team:
You are mixing up two concepts; 1) having an executable in the search path so you can execute it from any directory, just by typing its name and 2) running a script by passing the file name as an argument to the sh command. 2) does not relate to 1). A shell script passed as argument will not be found through searching the PATH . If you wish to be able to run the script by only typing its name, 1) make it executable and 2) move it to a folder that is in your current PATH (preferred), or add the path to the script to the PATH variable (like you did). You run it like: pass.sh If you wish to run the script by passing the file name of the script as an argument to the sh command, 1) there is no...
Full answer by vanadium: https://askubuntu.stackexchange.com/a/1564464 (CC BY-SA 4.0).
Need it done for your business? UphillTech.