I've had working script, which suddenly doesn't works. It contains something like this:
while read url;
do
curl $url
done < links
links file:
http://duckduckgo.com
http://google.com
And I get couldn't resolve hostname error.
curl: (6) Could not resolve host: google.com
curl: (6) Could not resolve host: duckduckgo.com
But, when the loop is removed, it works so it's not a network problem.
url="http://google.com"
curl $url
I've been looking into this whole day and I believe it is some stupidity but I wasn't able to figure it out. (quotes tried)
links
file since the last time this worked? Is there any chance that you got invisible characters (like carriage returns) in there? Tryread url < links; curl $url
(should do the first line only).links
file. I tried Scott's example and didn't have any issue when using my own, hand-craftedlinks
file. Have your tried your script with a customlinks
file?