Created
April 16, 2015 12:11
-
-
Save nemisj/14dfdeb8a7d6e8903d1a to your computer and use it in GitHub Desktop.
Adds all the folders inside ~/bin to the $PATH
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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