I have added a shell script to my ~/bin folder. When I type the script name normally in the terminal it finds the script just fine. However, when trying to launch the script using the sudo prefix, I get sudo: apt-get4: command not found.
Command that works: apt-get4
Doesn't work: sudo apt-get4 update
Currently the script is owned by the user pi with executable privileges, and I also chmod 777'd.
The script filename is 'apt-get4'.
Any ideas?