0

I used wget within bash to download a bunch of files from a parameterized URL. My URL file looked something like this:

http://www.example.com/Home/Sales?lrsn=48726
http://www.example.com/Home/Sales?lrsn=48727
http://www.example.com/Home/Sales?lrsn=48728
...and so on

I ran this wget command to fetch all the files into my directory:

wget -i urlfile.txt

The resulting set of files-- when I do an ls in my directory-- has names like this:

'Sales?lrsn=48726'
'Sales?lrsn=48727'
'Sales?lrsn=48728'

My problem is that I cannot figure out how to use wildcards with those files. E.g., if I type ls 'Sales*8', I would expect it to list 'Sales?lrsn=48728' (and any other matches). Instead, I get "No such file or directory".

Questions:

  1. What do I need to do to use wildcards with the files that my wget operation created? Simple example would be how to match using ls.
  2. How would one even create such files to reproduce this. I.e., I tried touch 'text.txt' and touch "'test.txt'" and other variations, but I can't seem to make a file that lists as 'test.txt' (starting and ending single-quotes).
  3. Is there a simple way to provide a naming convention for downloads using the wget -i input mode? (I'm pretty sure the answer to this is "No," but... figured I'd ask.)
Marc
  • 101

0 Answers0