#/bin/bash source travian.conf WGET_ARGS=("--load-cookies=$COOKIE_FILE " ); for FILE in $@ do if [ -r $DOWNLOAD_DIR/$FILE ]; then echo "File $FILE exists" else FILES+="$FILE " fi done WGET_ARGS+=$FILES echo ${WGET_ARGS[@]} #cd cache wget "${WGET_ARGS[@]}"