TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TCLUG:9065] More regex...



On Sun, 10 Oct 1999, Ben Beuchler wrote:

> First of all, can anyone point me towards a good regular expression
> tutorial?

There's a good one in *Unix for the Impatient*. The O'Reilly book *sed and
awk* will tell you more than you ever wanted to know.


> And...  When I use 'locate' I would like to be able to point it to just the
> exact match for a file name.
> Ex:
> 
> locate traceroute
> 
> returns:
> 
> /usr/doc/kde/HTML/en/knu/knu-traceroute.gif
> /usr/man/man8/traceroute.8
> /usr/sbin/traceroute
> /home/insyte/.kpackage/traceroute-1.4a5-16.i386.rpm
> 
> when all I really wanted was /usr/sbin/traceroute.

'which traceroute', assuming traceroute is in your $PATH.


> It's not so bad in this case, but some other files will return two or three
> screens of irrelevant information.  I assume this would be a fairly simple
> expression, but I just can't track down a way to do it.

Pipe through grep, perhaps several times. I've been known to do that.


----------------------------------------------------------------------
  Christopher Reid Palmer : http://www.innerfireworks.com/

  'I've been crawling on my belly,
  clearing out what could have been' 
  -- Tool