LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Problem in capturing url response (https://www.linuxquestions.org/questions/linux-newbie-8/problem-in-capturing-url-response-824504/)

saurabhmehan 08-06-2010 01:27 AM

Problem in capturing url response
 
Hi

I am caprturing the response of three URLs which are in file named urls.txt using following command and write response in output.txt file.

####Code############
wget -i urls.txt -q -O - | tee output.txt
###########End of code
Now i am finding the case where url is not responding and that output is not available to me in the file and on console i am getting "Could not connect to host".

Now i want to modify my urls.txt to have two fields:
Name and URL
Example:
URL1 | http://10.0.0.2/xsc/abc
URL2 | http://10.0.0.1/lkj/csv
URL3 | http://10.0.0.5/sdf/plk

I want to execute each url and print there response against each name
Example:
URL1 : CONNECTED
URL2 : NOT CONNECTED
URL3 : NOT CONNECTED

Help me
Thanks in advance.

Tinkster 08-06-2010 06:20 PM

Closed. 4th dupe ... please re-read our RULES you agreed to.


All times are GMT -5. The time now is 09:50 PM.