[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [SLUG] Re: search and replace
On Wed, 28 Jun 2000, Herbert Xu wrote:
> On Wed, Jun 28, 2000 at 11:49:45AM +1000, Peter Samuel wrote:
> >
> > I don't think the \> is GNU. It works with vi and grep under Solaris
> > and they are AT&T derived rather than GNU.
>
> Well, what I mean is that it isn't sanctioned by Single Unix.
>
> > Given that the files are DNS, the .org should be followed by a dot to
> > indicate the end of the TLD or separate the .org from the TLD, try
> > this
> >
> > :g/\.org\./.com./g
>
> Sorry, but this still catches www.org.com which is real :)
True, but whoever posted the original request is almost certainly NOT
the hostmaster for that domain.
>
> Though my previous solution was also incorrect in that it would catch www.org
> if you were in the "com." zone. So try this instead,
>
> sed 's/\.org\.\([[:blank:]]\|$\)/.com.\1/g'
Cool. Requires a GNU sed, if I'm not mistaken. Also requres a file swap.
Regards
Peter
----------
Peter Samuel peter@nospam.eserv.com.au
Technical Consultant or at present:
eServ. Pty Ltd Peter.Samuel@nospam.ind.tansu.com.au
Phone: +61 2 9206 3410 Fax: +61 2 9281 1301
"If you kill all your unhappy customers, you'll only have happy ones left"
--
SLUG - Sydney Linux Users Group Mailing List - http://www.slug.org.au
To unsubscribe send email to slug-request@nospam.slug.org.au with
unsubscribe in the text