Skip to content

Instantly share code, notes, and snippets.

@vreemt
Forked from Sandra-headscape/download.sh
Created June 25, 2025 11:10
Show Gist options
  • Save vreemt/ef405570189ba353309809d244381799 to your computer and use it in GitHub Desktop.
Save vreemt/ef405570189ba353309809d244381799 to your computer and use it in GitHub Desktop.
Download list of URLs from a txt file
#!/bin/bash
INPUT=$(find . -name "*.txt")
COUNT=1;
while IFS= read -r line
do
curl -O "$line"
let COUNT++
done < "$INPUT"
echo "count $COUNT"
@vreemt
Copy link
Author

vreemt commented Jul 4, 2025

Sandra-headscape commented Nov 23, 2023

make sure there's a single txt file in the directory
make sure file uses LF line endings
on a mac, you may need to use chmod +x download.sh to make the file executable

@vreemt
Copy link
Author

vreemt commented Jul 4, 2025

count will count all lines (also empties empties and things that fail to download)

count will count all lines (also empties and things that fail to download)

Sandra-headscape commented on Nov 24, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment