[oclug] ...and speaking of awk...
Jonathan Earle
jearle at nortelnetworks.com
Fri Feb 23 16:57:15 EST 2001
> -----Original Message-----
> From: Joe Burpee [mailto:jeb at burkby.com]
>
> Jonathan Earle wrote:
> > What is the issue with an additional process?
> ...
> > One other sed related question though.
> ...
> > nslookup 216.122.141.15 2>/dev/null | \
> > grep "Name" | \
> > cut -d : -f 2 | \
> > sed "s/.lightrealm.com//g" | \
> > sed "s/ //g"
>
> nslookup 216.122.141.15 2>/dev/null |
> sed -n 's/^Name: *\([^.]*\).*/\1/p'
Oh God...! that'll take me a while to pull apart. Quite the regex... and it
works... dunno why, yet. :)
> But "What is the issue with an additional process?" (or several) ;-)
hehe... I was waiting for that to come along. :) I just thought it looked
silly to have two seds in a row, each essentially performing a very simple
operation, and I wondered if this well-aged tool had been written to
accomplish more than one expression in one pass. As David pointed out, that
is indeed the case.
Cheers!
Jon
More information about the OCLUG
mailing list