• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Router's IP address - how to grep
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Router's IP address - how to grep
      • From: Joe <email@hidden>
References: 
 >Router's IP address - how to grep (From: Joe <email@hidden>)

  • Prev by Date: Router's IP address - how to grep
  • Next by Date: Re: Router's IP address - how to grep
  • Previous by thread: Router's IP address - how to grep
  • Next by thread: Re: Router's IP address - how to grep
  • Index(es):
    • Date
    • Thread