Last active
August 29, 2015 14:28
-
-
Save pjanuario/20a367a6b07317adcebc to your computer and use it in GitHub Desktop.
Bash script to download files from a comma separated source file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir -p /tmp/downloaded_files | |
while IFS='' read -r line || [[ -n "$line" ]]; do | |
#echo "Text read from file: $line" | |
filename=$(echo $line | cut -d "," -f 1) | |
url=$(echo $line | cut -d "," -f 2) | |
echo "url: $url filename: $filename" | |
curl $url -o "/tmp/downloaded_files/$filename" | |
done < "$1" | |
echo "files are in /tmp/downloaded_files" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
NOTE: The file need to be in the following format: