Skip to content

Instantly share code, notes, and snippets.

@kimsondrup
Last active April 19, 2023 13:58
Show Gist options
  • Save kimsondrup/f22717fa7677b21d14284964fc8d06e7 to your computer and use it in GitHub Desktop.
Save kimsondrup/f22717fa7677b21d14284964fc8d06e7 to your computer and use it in GitHub Desktop.
Add to ~/.bashrc to ensure that ~/bin is in PATH if the directory exists and if not already present
# Checks if the "$HOME/bin" directory exists
if [ -d "$HOME/bin" ]; then
# If "$HOME/bin" is not in PATH then add it
case ":${PATH}:" in
*:"$HOME/bin":*)
;;
*)
export PATH="$HOME/bin:$PATH"
;;
esac
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment