Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Aug 2000 00:22:18 -0700
From:      Kent Stewart <kstewart@urx.com>
To:        Mark Ovens <marko@FreeBSD.ORG>
Cc:        Ben Smithurst <ben@FreeBSD.ORG>, doc@FreeBSD.ORG
Subject:   Re: locate(1) manpage
Message-ID:  <39A37BAA.BE29A9E0@urx.com>
References:  <20000820130425.B254@parish> <20000820212720.C84036@strontium.scientia.demon.co.uk> <20000822202520.E254@parish> <20000822214151.W20036@strontium.scientia.demon.co.uk> <20000822232609.K254@parish>

next in thread | previous in thread | raw e-mail | index | archive | help


Mark Ovens wrote:
> 
> On Tue, Aug 22, 2000 at 09:41:51PM +0100, Ben Smithurst wrote:
> > Mark Ovens wrote:
> >
> > > I understand what you mean, but I think it is more complicated than
> > > that. Try
> > >
> > >       # locate "/include/"
> > >       # locate "*include/"
> > >       # locate "/include*"
> >
> > This is explained elsewhere in the manpage.  (This is a polite way of saying
> > "RTFM" ;-)
> 
> The point of this thread is that the FM is difficult to FU :)

I agree 100%.

> 
> >
> >      As a special case, a pattern containing no globbing characters (``foo'')
> >      is matched as though it were ``*foo*''.
> 
> Yes, I know, but the suggestion in the previous paragraph is that
> ''/'' is somehow special, or at least handled differently.
> 
> I'll trawl through the source again and try to get my head around it.
> Maybe its just the wording that's the problem and that it is trying to
> say exactly what you said (re ``echo *'').

You got me to thinking. Dangerous thing after driving 300km to a
volcano, walking around with a camera, and then driving home. Locate
has alway slightly irritated me because of the abundance of
information. What I wanted was a quick and dirty way of finding the
combinations of something like rc?d (rc.d was what I was looking for
as an example). Anything else that fit into the "?" was fine too. I
found that once I added the ?, I had to add where the wild card info
could fit. In this case it was the path to rc.d. I tried locate *rc?d
and got what I wanted. The thing is there are 100's of files that fit
"locate rc.d", which is really a locate "*rc.d*", and that is what I
wanted to get away from. I thought I would have to protect some of it
but I didn't. A locate *r?.d found some interesting combo's in
addition to rc.d. There were some r[123].d's. A locate *r[123].d just
found them. It turned out that I didn't have to protect some of the
things I thought I would have to protect. For example, you can "locate
6/include" and find all of the files in X11R6/include. 

I think the write up for locate is misleading but it could be because
I'm tired.

Kent
> 
> >
> > So "locate /include/" is the same as "locate */include/*" which matches
> > "/usr/include/ctype.h", but "/include*" is just treated as "/include*",
> > which "/usr/include/ctype.h" doesn't match.
> >
> > --
> > Ben Smithurst / ben@FreeBSD.org / PGP: 0x99392F7D
> 
> --
>                 4.4 - The number of the Beastie
> ________________________________________________________________
> 51.44°N  FreeBSD - The Power To Serve http://www.freebsd.org
> 2.057°W  My Webpage http://ukug.uk.freebsd.org/~mark
> mailto:marko@freebsd.org                http://www.radan.com
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-doc" in the body of the message

-- 
Kent Stewart
Richland, WA

mailto:kbstew99@hotmail.com
http://kstewart.urx.com/kstewart/index.html
FreeBSD News http://daily.daemonnews.org/


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-doc" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?39A37BAA.BE29A9E0>