If you have several files that you want to download that may or may not exist, you can keep it somewhat elegant using the for loop.
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
The result will look like this:
$ . ~/.bashrc loaded $HOME/path/to/dir/containing/files/somefile1 loaded $HOME/path/to/dir/containing/files/somefile2
modle13 Jan 11 '17 at 18:26 2017-01-11 18:26
source share