Try this:
- Save the script as
apt-proxy
(without the.sh
extension) in some directory, like~/bin
. - Add
~/bin
to yourPATH
, typingexport PATH=$PATH:~/bin
- If you need it permanently, add that last line in your
~/.bashrc
. If you’re usingzsh
, then add it to~/.zshrc
instead. - Then you can just run
apt-proxy
with your arguments and it will run anywhere.
Note that if you export
the PATH variable in a specific window it won’t update in other bash instances.