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/scripts
While 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