Created
August 5, 2020 22:26
-
-
Save colegeissinger/3b87af03fccbeecfae19a5c39e472f7d to your computer and use it in GitHub Desktop.
Loop over a CSV of image URL's and download them while retaining the folder structure.
This file contains 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
#!/usr/bin/env bash | |
filename="$1" | |
while IFS="," read f1 | |
do | |
# Remove the carriage return on the URL which makes for invalid URL's on some servers. | |
URL=$(echo $f1 | tr -d '\r') | |
# Fetch the file. | |
wget -x -nH "$URL" | |
done < "$filename" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment