Re: Router's IP address - how to grep
Re: Router's IP address - how to grep
- Subject: Re: Router's IP address - how to grep
- From: Joe <email@hidden>
- Date: Thu, 15 May 2008 13:54:08 -0700
Mark J. Reed wrote:
>If you're on Leopard, you can use the -o option to grep to return only
>the portion of the line that matches, but that means the pattern has
>to include everything you want to see. Something like this may work:
>
>do shell script "/usr/local/bin/lynx -dump " & quoted form of theURL &
>" | grep -o 'Internet
>Address:[^0-9]*[0-9]*\\.[0-9]*\\.[0-9]*\\.[0-9]*' "
Thanks Mark. Your script works as written and returns:
"Internet Address: 95.88.232.31"
I want to get only the numeric portion so I tried removing "Internet Address:" from the pattern. However that shows me the whole line.
" o Internet Address: 95.88.232.31"
I know I could revert to AppleScript at this point and use 'offset of' but can I get only the numeric part with the grep command?
Joe
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden