Skip to content

Instantly share code, notes, and snippets.

@modle
Last active January 11, 2017 18:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save modle/4096728b728baf35c0573c2d124c4fd4 to your computer and use it in GitHub Desktop.
Save modle/4096728b728baf35c0573c2d124c4fd4 to your computer and use it in GitHub Desktop.
.bashrc which loads a list of files
files=(somefile1 somefile2)
path="$HOME/path/to/dir/containing/files/"
for file in ${files[@]}
do
file_to_load=$path$file
if [ -f "$file_to_load" ];
then
. $file_to_load
echo "loaded $file_to_load"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment