michaelsanford
Translator, Web Developer
I have a long plain text file whose every line is a complete URL like http://server.com/file_xx.mp3 no spaces or quotes. Each line ends with (what appears with both pico and cat) a newline.
My problem is that I need to use curl (or any other utility you can suggest) to download the files listed in fixed.txt. When I issue cat fixed.txt the file prints just fine with one URL per line. BUT if I issue echo `cat fixed.txt` the newlines get transformed into spaces.
This is problematic because I'm downlading using curl -O `cat fixed.txt` so the first file downloads just fine but the subsequent files are outputted to STDOUT (i.e., binary data printed to the terminal and not to a file).
Should I be using a script to read each subsequent line from fixed.txt to call a new instance of curl, or something ? I'm surprised simply backticking doesn't work !
My problem is that I need to use curl (or any other utility you can suggest) to download the files listed in fixed.txt. When I issue cat fixed.txt the file prints just fine with one URL per line. BUT if I issue echo `cat fixed.txt` the newlines get transformed into spaces.
This is problematic because I'm downlading using curl -O `cat fixed.txt` so the first file downloads just fine but the subsequent files are outputted to STDOUT (i.e., binary data printed to the terminal and not to a file).
Should I be using a script to read each subsequent line from fixed.txt to call a new instance of curl, or something ? I'm surprised simply backticking doesn't work !