Skip to content

Instantly share code, notes, and snippets.

@ddikman
Created Aug 25, 2021
Embed
What would you like to do?
Bash script to download a list of URLs
#!/bin/bash
# usage:
# chmod +x download.sh
# pbpaste | download.sh
# cat inputfile.txt | download.sh
# thanks to https://stackoverflow.com/a/7045517
while read -r full_url
do
echo "downloading ${full_url}"
curl "$full_url" --output $(basename ${full_url})
done < "${1:-/dev/stdin}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment