getting IP address of router

Peter L. Peres plp-ysDPMY98cNQDDBjDh4tngg at public.gmane.org
Sun Feb 13 09:51:25 UTC 2005



On Sun, 13 Feb 2005, jim ruxton wrote:

>
>>
>> echo "abc IP: 1.2.3.4</title>"|sed  's/.* IP: \(.*\)<\/title>.*/\1/'
>>
> Yup this works??

Therefore whatever that site returns does not match the regexp above. 
Fix the regexp. I suggest that a better regexp will be:

's/IP:[ \t]*\(.*\)<\/title>.*/\1/'

(and this time pipe the output of curl into it). If it still does not 
work, *do* look at the output of curl character by character, f.ex. 
using od -Ax -tax1

good luck,
Peter
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list