The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
help find wget, less, unzip source code goldfish UNIX for Dummies Questions & Answers 4 03-04-2008 04:48 PM
Please verify the simple Shell code thepurple Shell Programming and Scripting 2 10-04-2007 10:13 AM
Copy code from shell yohoshua UNIX for Dummies Questions & Answers 1 10-12-2006 02:20 AM
how to convert from korn shell to normal shell with this code? forevercalz Shell Programming and Scripting 21 11-23-2005 02:18 AM
check my code?? running shell from c? abdul UNIX for Dummies Questions & Answers 1 09-03-2001 03:05 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-28-2006
rajbal rajbal is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 19
Response Code using wget in shell

I am trying to get the status code of a web request,size of the download file and response time using wget.
When i use the command: wget <sitename> ,it gives all these parameters in the command line.But i want to get these values seperately and assign in different variables using shell script.Is it possible using wget?If any other methods are available i will appreciate that..

Thanks and Regards,
Rajesh
  #2 (permalink)  
Old 09-28-2006
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
Supporter
  
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,350
Do you want to capture the HTTP requests and their status?
Try this:
Code:
wget filename_to_get 2>&1|egrep "HTTP|Length|saved"
This will get you your files. You need to do the 2>&1 so that the stderr, where wget writes all this info is routed to stdout. This in turn is piped to the egrep which gives you your output.
  #3 (permalink)  
Old 09-28-2006
srikanthus2002's Avatar
srikanthus2002 srikanthus2002 is offline
Registered User
  
 

Join Date: Sep 2006
Location: Can u guess...!
Posts: 160
you can also use tee command of same

wget filename_to_get | tee out_file |egrep "HTTP|Length|saved"
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 01:33 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0