Add a bash script to path

Try this:

  • Save the script as apt-proxy (without the .sh extension) in some directory, like ~/bin.
  • Add ~/bin to your PATH, typing export PATH=$PATH:~/bin
  • If you need it permanently, add that last line in your ~/.bashrc. If you’re using zsh, 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.

Leave a Comment