Skip to content

Instantly share code, notes, and snippets.

@ismyrnow
Created February 10, 2017 06:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ismyrnow/f41de9c03739c4fc2d53bbd634edaaf8 to your computer and use it in GitHub Desktop.
Save ismyrnow/f41de9c03739c4fc2d53bbd634edaaf8 to your computer and use it in GitHub Desktop.
Given a space-separated list of URL and filename pairs, download them in sequence
# feed each line of text file to sed, which extracts url/filename, and outputs a curl command, which is fed to shell.
cat url-filename-list.txt | sed 's/\([^ ]*\) \(.*\)/curl "\1" -o "\2"/' | sh
http://www.example.com/1293859 nicename.mp3
http://www.example.com/2093028 nicename.mp3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment