[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [SLUG] Re: search and replace



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 :)

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'
-- 
Debian GNU/Linux 2.1 is out! ( http://www.debian.org/ )
Email:  Herbert Xu ~{PmV>HI~} <herbert@nospam.gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
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