I'm trying to download files using wget and for some reason I think I'm encountering some problems with string interpolation. I have a list of files to be downloaded that I have successfully parsed etc (no small feat for me) and would like to incorporate these into a for loop wget statement combo which downloads these files en masse.
Please forgive me the URLs won't work for you because the password and data have been changed.
I have tried single and double quotes as well as escaping a few characters in the URL (the &s and @s which I presume are at the marrow of this).
list of files
files.txt
/results/KIDFROST@LARAZA.com--B627-.txt.gz
/results/KIDFROST@LARAZA.com--B626-part002.csv.gz
/results/KIDFROST@LARAZA.com--B62-part001.csv.gz
wget
statement works as a single command
wget -O files/$i "https://tickhistory.com/HttpPull/Download? user=KIDFROST@LARAZA.com&pass=RICOSUAVE&file=/results/KIDFROST@LARAZA.com--N6265-.txt.gz"
but a loop doesn't work
for i in `cat files.txt`; do
wget -O files/$i "https://tickhistory.com/HttpPull/Download? user=KIDFROST@LARAZA.com&pass=RICOSUAVE&file=$i"
done