LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Capture reponse of 20 different URL hits in single shell script (https://www.linuxquestions.org/questions/linux-newbie-8/capture-reponse-of-20-different-url-hits-in-single-shell-script-824328/)

saurabhmehan 08-05-2010 05:41 AM

Capture reponse of 20 different URL hits in single shell script
 
I need to execute 20 urls in one shell script and display there responses on the console and write on text file too.
Please consider the case when url is not responding.

Please help.

Thanks in advance..

cantab 08-05-2010 06:09 AM

wget -i urls.txt -q -O - | tee output.txt

urls.txt contains the urls, one per line

This will write all results concatenated to the one file, output.txt, as well as displaying them on the screen. Wgets progress messages should not show. Errors will show but won't be in output.txt

linuxlover.chaitanya 08-05-2010 06:34 AM

It is a duplicate thread and reported.

saurabhmehan 08-05-2010 10:51 AM

Hi cantab,
Can u help me in the script mention by you that if url is not reponding then it will display output as "Not connected" in Red color and if url is responding it shows output as "OK" in green color.

Thnaks in advance..
Quote:

Originally Posted by cantab (Post 4056626)
wget -i urls.txt -q -O - | tee output.txt

urls.txt contains the urls, one per line

This will write all results concatenated to the one file, output.txt, as well as displaying them on the screen. Wgets progress messages should not show. Errors will show but won't be in output.txt


Tinkster 08-05-2010 02:13 PM

Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.


http://www.linuxquestions.org/questi...4/#post4056588


All times are GMT -5. The time now is 07:29 PM.