if [ -d $download_path ] then echo "Downloading to $download_path" cd $download_path else mkdir $download_path echo "Downloading to $download_path" fi ############################################################# ### This is the list method to be used with the -s switch ### ############################################################# if [[ "$method" == "list" ]] then cat $conf_path/$list | while read line && [ $(du -c $download_path | tail -n 1 | head -c -6) -lt $max_size ] && [ $(find $download_path | wc -l) -lt $max_files ] do cd $download_path