LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Closed Thread
  Search this Thread
Old 08-05-2010, 06:41 AM   #1
saurabhmehan
Member
 
Registered: Jul 2010
Posts: 44

Rep: Reputation: 0
Question 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..

Last edited by saurabhmehan; 08-05-2010 at 06:47 AM. Reason: Spell Check
 
Old 08-05-2010, 07:09 AM   #2
cantab
Member
 
Registered: Oct 2009
Location: England
Distribution: *buntu, Vector
Posts: 499

Rep: Reputation: 102Reputation: 102
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
 
1 members found this post helpful.
Old 08-05-2010, 07:34 AM   #3
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
It is a duplicate thread and reported.
 
Old 08-05-2010, 11:51 AM   #4
saurabhmehan
Member
 
Registered: Jul 2010
Posts: 44

Original Poster
Rep: Reputation: 0
Wink

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 View Post
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
 
Old 08-05-2010, 03:13 PM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
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
 
  


Closed Thread

Tags
asap


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
single shell script to download software updates narendra1310 Linux - Software 2 02-20-2010 03:14 AM
Can we open a browser (firefox/IE) & enter URL in it via shell/PERL script. barde Linux - Newbie 6 02-18-2009 06:21 AM
single command in shell script not working farkus888 Programming 5 04-01-2008 02:31 PM
500 EOF instead of reponse status line in perl script Sherlock Programming 7 05-16-2007 07:52 AM
How to read a single line from a text file into a shell script. SkipHuffman Linux - Software 2 08-16-2006 03:10 PM


All times are GMT -5. The time now is 02:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration