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

Mathieu Petit-Clair mathieu.petitclair at gmail.com
Tue Jan 8 14:00:20 WST 2008


Kirk Turner wrote:
> On Jan 8, 2008 11:43 AM, Michael Holland <michael.holland at gmail.com> wrote:
>>    There is a -regexp option, but   "slocate --regexp '.*\.foo$' "
>> matches nothing. Why doesn't the $ match end of filename?
> 
> A slight syntax difference is the reason. From the man:
> 
> slocate [-i] [-r <regexp>] [--regexp=<regexp>]
> 
> "slocate --regexp='.*\.foo$' "
> 
> or
> "slocate -r '.*\.foo$' "
> 
> Will get you what you want.
> 

Or (did I not understand something?) just :
slocate -r '\.foo$'

I think slocate does a substring search by default, so the first '.*' is
actually optionnal.

Mat




More information about the plug mailing list