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: "Mark J. Reed" <email@hidden>
- Date: Thu, 15 May 2008 16:20:19 -0400
On Thu, May 15, 2008 at 4:01 PM, Joe <email@hidden> wrote:
> That returns a whole page with a line about midway down containing the words
> "Internet Address:"
Are you sure it's not all on one line? Even if it wraps to fill the
monitor, grep will only see one "line" until it sees a linefeed
character... and it returns the whole line containing the matching
text you're looking for.
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]*' "
--
Mark J. Reed <email@hidden>
_______________________________________________
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