From owner-freebsd-net Thu Oct 14 9:37:13 1999 Delivered-To: freebsd-net@freebsd.org Received: from sugar.pharlap.com (sugar.pharlap.com [192.107.36.1]) by hub.freebsd.org (Postfix) with ESMTP id EDC4714BD7 for ; Thu, 14 Oct 1999 09:36:54 -0700 (PDT) (envelope-from clark@pharlap.com) Received: from clark ([192.107.36.171]) by sugar.pharlap.com (Post.Office MTA v3.5.2 release 221 ID# 0-56365U200L2S100V35) with SMTP id com; Thu, 14 Oct 1999 12:36:44 -0400 From: clark@pharlap.com (Clark Jarvis) Date: Thu, 14 Oct 1999 12:40:52 -0400 To: Mohit Aron , freebsd-net@freebsd.org In-Reply-To: <199910122012.PAA23666@cs.rice.edu> Subject: Re: Search a symbol in the source tree X-Mailer: MR/2 Internet Cruiser Edition for OS/2 v1.61 b62 Message-ID: <19991014163644223.AAA270@sugar.pharlap.com@clark> Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org In <199910122012.PAA23666@cs.rice.edu>, on 10/12/99 at 03:12 PM, Mohit Aron said: >> Can anyone suggest me a way of searching symbols in the entire /usr/src >> tree? I normally use grep */*. But grep does not work recursively, right? >> Something like a small shell script may do this. Thanks a lot. >Rather than using something equivalent to a recursive grep (which is >slow), I prefer to use etags. This gives me the flexibility of searching >for symbols from within emacs where emacs directly takes me to the >section of code that defines the symbol. [tags creation code deleted] I use a combination of tags and an unzipped tar file of the source tree, providing your text editor can handle large files and binary characters with some success. Just load up the tar file and search. Inside the tar file, the filespec for each file is stored in a block at the beginning of each file, so it only takes a little reverse searching to figure out where the file lives in the source tree. Tags are great, but they don't find where/how symbols are used, just where they are defined. And realizing that this is an old, ingrained behavior - etags may be able to do more than I'm aware of. -- Clark To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message