Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Oct 1999 12:51:17 -0400
From:      Bakul Shah <bakul@torrentnet.com>
To:        "Scott Hess" <scott@avantgo.com>
Cc:        n@nectar.com, ht5t-fry@asahi-net.or.jp, zzhang@cs.binghamton.edu, freebsd-hackers@FreeBSD.ORG, nectar@nectar.com
Subject:   Re: Search a symbol in the source tree 
Message-ID:  <199910181651.MAA16896@chai.torrentnet.com>
In-Reply-To: Your message of "Mon, 18 Oct 1999 08:46:32 PDT." <172501bf197f$f37008d0$1e80000a@avantgo.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
A couple of useful packages can make this much quicker.

mkid from ports/devel/id-utils builds a database of symbols
given a source tree.  Then you can use gid to grep for a
symbol, lid to get a list of files that havea symbol etc.
mkid knows about c, c++ and may be some other languages.

If you want to search for arbitrary words, you can use
glimpseindex from port/textproc/glimpse to build the database
and agrep to search for words.  agrep is like grep except
more powerful!  It can also do `approximate' searches among
other things.  Here is a handy agrep use to whet your
appetite.

zsh> rfc () { agrep -t -i -d'$$' $* /usr/local/doc/rfc/rfc-index.txt }

Now, for example, I can get a list of RFCs that W. Stevens wrote on IPv6:

zsh> rfc 'steve;ipv6'

2133 Basic Socket Interface Extensions for IPv6. R. Gilligan, S.
     Thomson, J. Bound, W. Stevens. April 1997. (Format: TXT=69737 bytes)
     (Obsoleted by RFC2553) (Status: INFORMATIONAL)

2292 Advanced Sockets API for IPv6. W. Stevens, M. Thomas. February
     1998. (Format: TXT=152077 bytes) (Status: INFORMATIONAL)

2553 Basic Socket Interface Extensions for IPv6. R. Gilligan, S.
     Thomson, J. Bound, W. Stevens. March 1999. (Format: TXT=89215 bytes)
     (Obsoletes RFC2133) (Status: INFORMATIONAL)

But I digress!  The point is there are better tools than what
is available in the "beginner's toolkit" of the basic Unix
commands.

Then there is `global' which can be used to generate tags
file as well as create an htmlized version of your source
tree.

Someone should write a `Unix powertools' book.  Not me.


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




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