From owner-freebsd-hackers Mon Oct 18 8:47:23 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from bomber.avantgo.com (ws1.avantgo.com [207.214.200.194]) by hub.freebsd.org (Postfix) with ESMTP id 758B814C25 for ; Mon, 18 Oct 1999 08:47:20 -0700 (PDT) (envelope-from scott@avantgo.com) Received: from river ([10.0.128.30]) by bomber.avantgo.com (Netscape Messaging Server 3.5) with SMTP id 240; Mon, 18 Oct 1999 08:42:10 -0700 Message-ID: <172501bf197f$f37008d0$1e80000a@avantgo.com> From: "Scott Hess" To: Cc: , , , References: <19991017163712.3911B1D95@bone.nectar.com> <19991018031731U.tfuruya@galois.tf.or.jp> Subject: Re: Search a symbol in the source tree Date: Mon, 18 Oct 1999 08:46:32 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Of course, this is probably more efficiently run as 'find . -name "*.c" -print | xargs egrep -i idt | less'. If you have interesting filenames (containing spaces, for instance), you'll probably want to use -print0 and whichever -0 to xargs. zsh users can often use 'egrep -i idt **/*.c', but that doesn't work so well if you have too many matches for the command-line to handle. [Yes, anything like this is "slow" for some definition of the word "slow". On a particular source tree I frequently work with, the *.c files contain 256klines of code, and running a find/xargs egrep on them takes 11s on the first run - and <1s on the second. Quite sufficient if you tend to do most of your work in a single module and only periodically need to foray onto unfamiliar terrain...] Later, scott ----- Original Message ----- From: )> To: Cc: ; ; ; Sent: Sunday, October 17, 1999 11:17 AM Subject: Re: Search a symbol in the source tree > 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. > > Teddy Furuya > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message