getting IP address of router

Peter L. Peres plp-ysDPMY98cNQDDBjDh4tngg at public.gmane.org
Sat Feb 12 15:13:01 UTC 2005



On Fri, 11 Feb 2005, jim ruxton wrote:

> On Fri, 2005-02-11 at 10:21, Peter L. Peres wrote:
>> On Fri, 11 Feb 2005, jim ruxton wrote:
>>
>>> Thanks Anton, No this router doesn't support SNMP. It's ok though
>>> because others have pointed out alternative methods that seem to work.
>>> Except I'm still having trouble figuring out why the following script
>>> doesn't work properly for me where it does for other people. If anyone
>>> has any suggestions why I'm eager to hear them.
>>>
>>> # curl -s -o - http://www.myip.dk | sed  's%.* IP: \(.*\)</title>.*%\1%'
>>
>> What is your shell ? You should also use sed -e <continue as above> imho
> GNU bash, version 2.05b.0(1)-release (i386-redhat-linux-gnu)
>
> It doesn't make a difference whether I include the -e or not
> Jim

Try this, does it work ?:

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

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