This topic has been discussed already but every post I've read just confuses me even more. For example, take this simple bash hello world script called test. I created it as the user Bill and did a chmod 755 test to make it executable. The script resides in /home/Bill/scripts and I tried doing exports PATH=$PATH:/home/Bill/scriptsWhile I'm in that directory I can run the script fine using ./test. But if I back out into /home/Bill I get a -bash: ./test: No file or directory And if I switch into root, I can't find the script even though I've added it to my environment path or I think I did using the export command. I've also read that I can add the script path into my /etc/sudoers and have no password required but this requires the user to run sudo ./test. Is there someway to just make this script universally accessible and executable from any user anywhere?As another side note, i'm kind of confused on the difference between ./test vs test I created the script as test but when I or any other user runs it do they run it as ./test or just test 
How to allow a script to be run by anyone anywhere
shell script;path
You can execute a script either by specifying a path (relative or absolute) to the script, or by ensuring that the directory containing the script is in your shell's search $PATH.Temporarily ignoring the fact that test is not a good name for this example, as there are other tests your shell may choose to execute, you can always execute the script by name test if the containing directory is in your $PATH.  This is what you have done with export PATH=$PATH:/home/Bill/scripts.  In the terminal in which you have set this $PATH, you can execute test regardless of your current working directory.If the script is not in your $PATH, or you want to explicitly specify which test you want to execute, you can provide not just the filename, but a relative or absolute path to the file.  So, again regardless of your current working directory, you can always execute the script by providing the full path: /home/Bill/scripts/test.You can also execute the script by providing a relative path; for some examples, where the prompt indicates your working directory:/home/Bill/scripts$ ./test/home/Bill$ scripts/test/home/Bill/documents$ ../scripts/test/home/James/documents$ ../../Bill/scripts/testThe reason you receive an error when you tried to execute/home/Bill$ ./testis because there is no file /home/Bill/test, which is what you are trying to execute (the file test in the current directory .)If you want all users to be able to run the script simply with its name, without giving a absolute or relative path to the script, it must be in everyone's $PATH.  You can do this either by having every user add /home/Bill/scripts to their $PATH, or by putting the script in a location that is in the default $PATH for all users, such as /usr/local/bin. But you'll have to call your script something other than test, because test is a special case: it's a shell built-in command.