[plug] How to "locate *.foo" ??

Gregory Orange gregory.orange at metoceanengineers.com
Tue Jan 8 13:29:24 WST 2008


Michael Holland wrote:
> Gregory Orange wrote:
> 
>> Hehe that's something I've never understood. So I use
>> "locate .foo | egrep \.foo$"
> 
> Ta, I added the following to .zshrc:
> 
>   loc(){ slocate $1 | egrep $1$ }
>   alias locate='noglob loc'
> 
> Now I can "locate *.foo" faster than using PERL. A bit of a hack though?

It works and it's using each tool in a non-hack way, but I agree - the 
combined use has always felt to me like a bit of a hack. Further, for 
CPU Clock Cycle Nazis and non-CCCNs[1] alike, it's less efficient.

A nitpick to note - your entry will find anything with foo on the end, 
not just anything with .foo on the end - note that I escape the . 
(any-character) character with the backslash.

Greg.

[1] Wa oh, I just invented a layered ETLA (LETLA?)



More information about the plug mailing list