2
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)
Your script works fine for me. Is there something else about the environment you're running under that might be missing? – Joel Taylor – 2013-09-11T17:19:13.233
I've no clue. Using Arch, recently did upgrade (pacman -Syyu) – Lukasik – 2013-09-12T06:29:53.213
1Have you edited your
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). – Scott – 2013-09-12T21:55:38.640Yes, it is output from another script. Your example doen't works. I tried it in fresh install of xubuntu in virtual and got the same result. – Lukasik – 2013-09-13T09:37:47.713
The issue must be with your
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? – Joel Taylor – 2013-09-13T21:24:20.010Sure, that was first thing I've tried – Lukasik – 2013-09-14T09:34:34.373