Last active
September 4, 2021 13:47
-
-
Save chandruscm/ef250e26ba307f028073bb582db34a42 to your computer and use it in GitHub Desktop.
Shell script to download images listed in an images.txt folder. Each line has the imageUrl and the fileName to be saved, separated by a space. To run ${zsh download-images.sh}. Reference: https://stackoverflow.com/questions/36192423/wget-download-files-with-filename-from-list-of-urls-using-wget
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
#!/bin/sh | |
IFS=$'\n' | |
for line in $(cat images.txt) | |
do | |
url=$(echo $line | awk '{ print $1 }') | |
out=$(echo $line | awk '{ print $2 }') | |
wget --user-agent="Mozilla" "$url" -O "$out" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment