Skip to content

Instantly share code, notes, and snippets.

@nemisj
Created April 16, 2015 12:11
Show Gist options
  • Save nemisj/14dfdeb8a7d6e8903d1a to your computer and use it in GitHub Desktop.
Save nemisj/14dfdeb8a7d6e8903d1a to your computer and use it in GitHub Desktop.
Adds all the folders inside ~/bin to the $PATH
function get_dynamic_path() {
root="$HOME/bin"
new_path=""
for x in $(ls ${root}); do
full_path="$root/$x"
if [ -d $full_path ]; then
new_path="$full_path:${new_path}"
fi
done
echo $new_path;
}
export PATH=$(get_dynamic_path):$PATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment