Skip to content

Instantly share code, notes, and snippets.

@erickzanardo
Last active February 6, 2017 13:27
Show Gist options
  • Save erickzanardo/24455a82ec98b295426dd7c9454b83de to your computer and use it in GitHub Desktop.
Save erickzanardo/24455a82ec98b295426dd7c9454b83de to your computer and use it in GitHub Desktop.
Simple script to easy add env variables, or changing the path without having to always change the bash[rc,_profile,etc] file. Add these lines to your bash[rc,_profile,etc] file once and then just add files to the folder configured on the SOURCEABLE_DIR variable.
# Sourceables
SOURCEABLE_DIR=/home/erick/sourceable/
DIRS=($(ls $SOURCEABLE_DIR))
for dir in "${DIRS[@]}"; do
if [[ "$dir" != *.ignore ]]
then
source "$SOURCEABLE_DIR$dir"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment