Download missing file in bash script #!/usr/bin/env bash function downloadIfMissing { if [ -f $1 ]; then echo "File $1 exists." else wget $2 fi }