From owner-freebsd-hackers Mon Oct 18 9:52:35 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from chai.torrentnet.com (chai.torrentnet.com [198.78.51.73]) by hub.freebsd.org (Postfix) with ESMTP id 31D5814F31 for ; Mon, 18 Oct 1999 09:52:32 -0700 (PDT) (envelope-from bakul@torrentnet.com) Received: from chai.torrentnet.com (localhost [127.0.0.1]) by chai.torrentnet.com (8.8.8/8.8.5) with ESMTP id MAA16896; Mon, 18 Oct 1999 12:51:17 -0400 (EDT) Message-Id: <199910181651.MAA16896@chai.torrentnet.com> To: "Scott Hess" 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 In-reply-to: Your message of "Mon, 18 Oct 1999 08:46:32 PDT." <172501bf197f$f37008d0$1e80000a@avantgo.com> Date: Mon, 18 Oct 1999 12:51:17 -0400 From: Bakul Shah Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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