Re: Capturing output (domain name) of wget after http redirect
- From: Icarus Sparry <usenet@xxxxxxxxxxxxxxxxx>
- Date: 27 Sep 2007 05:25:08 GMT
On Wed, 26 Sep 2007 06:51:51 -0700, JamesG wrote:
On Sep 26, 2:32 pm, Icarus Sparry <use...@xxxxxxxxxxxxxxxxx> wrote:
There are now 2 remaining problems.
Because there are multiple hops (redirects) I get a list of several
entries.
For example:
Connecting towww.perfiliate.com|62.190.8.171|:80... connected.
Connecting to ad.uk.doubleclick.net|209.62.178.57|:80... connected.
Connecting to ad.doubleclick.net|65.205.8.52|:80... connected.
Connecting to ad.doubleclick.net|65.205.8.52|:80... connected.
Connecting to fls.doubleclick.net|216.73.87.48|:80... connected.
Connecting towww.theaa.com|213.225.133.206|:80... connected.
I need it to only select the last entry. The final problem is
seperating
www.theaa.comout. I think I can do this with "sed".
Any ideas on the first problem? Thanks
"tail -1", or if you are going to be using sed anyhow
sed -n '$s/Connecting to \([^|]*\)|.*/\1/p'
Thanks for the help.
Using that sed command doesn't seem to do the trick :(
I'm running: wget -S --spider http://www.google.com 2>&1 | sed -n '$s/
Connecting to \([^|]*\)|.*/\1/p'
Am I missing something stupid?
Thanks
I was rather expecting you to keep the grep in the command
wget -S --spider http://www.google.com 2>&1 >/dev/null |
grep '^Connecting to' |
sed -n '$s/Connecting to \([^|]*\)|.*/\1/p'
.
- Follow-Ups:
- References:
- Capturing output (domain name) of wget after http redirect
- From: JamesG
- Re: Capturing output (domain name) of wget after http redirect
- From: Joachim Schmitz
- Re: Capturing output (domain name) of wget after http redirect
- From: JamesG
- Re: Capturing output (domain name) of wget after http redirect
- From: Icarus Sparry
- Re: Capturing output (domain name) of wget after http redirect
- From: JamesG
- Capturing output (domain name) of wget after http redirect
- Prev by Date: Re: problem running cmd from ksh script
- Next by Date: Re: copy config files from one box to another
- Previous by thread: Re: Capturing output (domain name) of wget after http redirect
- Next by thread: Re: Capturing output (domain name) of wget after http redirect
- Index(es):
Relevant Pages
|
Loading