Sed-Fu (Err...)

Anderson Lizardo andersonlizardo at yahoo.com.br
Wed Dec 3 17:21:54 PST 2003


Jason Kircher wrote:
> > First of all, I strongly suggest you read some doc about "Regular
> > Expressions". It may solve many problems you may enconter while 
trying
> > to use regex-ready tools like grep and sed.
> 
> Know of such a good document on regex?

The basics are already on sed info pages. You can read more about 
regular expressions http://www.tldp.org/LDP/abs/html/regexp.html. 
Someone please suggest more links here.

> That's a regex page specific to perl.  Is there a more universal one?

There is a regex manual that comes with man-pages package. See "man 7 
regex". It's very basic, but serves as a quick reference.

> > > Reading a little more, and I tried:
> > > sed 's/.*\(:\)\1//' sitelog
> > > That hung sed.  (^C gets out, thankfully.)
> >
> > What is that?!? :)

Okay, now I see you've used "back reference". I've never used this 
feature before, so I didn't recognise it at first ;).

-- 
Anderson Lizardo




More information about the lfs-chat mailing list