From owner-freebsd-hackers Mon Oct 18 9:53:37 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from jumping-spider.aracnet.com (jumping-spider.aracnet.com [205.159.88.14]) by hub.freebsd.org (Postfix) with ESMTP id 4AF3D14F6E for ; Mon, 18 Oct 1999 09:53:35 -0700 (PDT) (envelope-from beattie@aracnet.com) Received: from shell2.aracnet.com (IDENT:1728@shell2.aracnet.com [216.99.193.20]) by jumping-spider.aracnet.com (8.9.3/8.9.3) with ESMTP id JAA31309; Mon, 18 Oct 1999 09:51:34 -0700 Received: from localhost by shell2.aracnet.com (8.8.7) id JAA12156; Mon, 18 Oct 1999 09:51:00 -0700 X-Authentication-Warning: shell2.aracnet.com: beattie owned process doing -bs Date: Mon, 18 Oct 1999 09:51:00 -0700 (PDT) From: Brian Beattie To: Tetsuro Teddy FURUYA Cc: n@nectar.com, zzhang@cs.binghamton.edu, freebsd-hackers@FreeBSD.ORG, nectar@nectar.com Subject: Re: Search a symbol in the source tree In-Reply-To: <19991018031731U.tfuruya@galois.tf.or.jp> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Mon, 18 Oct 1999, Tetsuro Teddy FURUYA wrote: > From: Jacques Vidrine > Subject: Re: Search a symbol in the source tree > Date: Sun, 17 Oct 1999 11:37:11 -0500 > n> On 18 October 1999 at 0:39, Tetsuro Teddy FURUYA (=?iso-2022-jp?B?GyRCOEVDKxsoQiAbJEJFL086GyhC?=) wrote: > n> > It seems queer to me that there has been none who has refered to > n> > find - exec > n> > pairs. > n> > > n> > You may type into shell like; > n> > $find . -name "*.c" -print -exec "egrep" "-i" "idt" {} \; | less > n> > Here , "idt" is a search string. > n> > n> That's because no one wants a separate invocation of egrep for > n> every file! > ^^^^^^ > Probably, except me ! > > But, what various and interesting methods to search symbols there are ! > > If we do not restrict the usage of search method, there might be > yet another methods. I frequently use find - grep when looking at a novel source tree. The one problem with the solution given is that if you are looking for a few instances in hundreds of files, the hits can scroll off the screen and get lost in the noise. My prefered approach is: find . -name "*.[c]" -exec grep string {} /dev/null \; (the /dev/null forces grep to print the filename where a match is found, and I am an old fogey, learned grep before [ef]grep too lazy to learn better, should probably use fgrep) What I'd really like to see is a free implementation of cscope. Brian Beattie | The only problem with beattie@aracnet.com | winning the rat race ... www.aracnet.com/~beattie | in the end you're still a rat To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message