I have been using this command:
cat urls.txt | xargs -n 1 -P 10 wget -q
to download text files of URLs. This worked fine when my URL file was like:
http://domain1.com/page.html http://domain2.com/page.html http://domain3.com/page.html
However I now need to download text files of URLs and post data, like:
--post-data '1=1' http://domain1.com/page.html --post-data '1=1' http://domain2.com/page.html --post-data '1=1' http://domain3.com/page.html
When using the above cat command it tries to download the URL and then the post data as a URL. e.g. in the above example, it would download http://domain1.com/page.html and then try and download --post-data 1=1, then http://domain2.com/page.html and so on.
Is there anyway to get cat to send each line of the URLs files only?
Update: I've found that by adding an escape to the space like:
--post-data '1=1'\ http://domain1.com/page.html
is making it be treated as one url, but the -- appear to be stripped from the --post-data argument.