From owner-freebsd-hackers Tue Oct 19 11: 4:25 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from ppp142132.asahi-net.or.jp (ppp142132.asahi-net.or.jp [202.213.142.132]) by hub.freebsd.org (Postfix) with ESMTP id 3AF5A1783E for ; Tue, 19 Oct 1999 11:04:16 -0700 (PDT) (envelope-from tfuruya@ppp142132.asahi-net.or.jp) Received: from localhost (localhost.tf.or.jp [127.0.0.1]) by galois.tf.or.jp (8.9.3/3.7W-Teddy-99050304) with ESMTP id CAA01948 for ; Wed, 20 Oct 1999 02:42:19 +0900 (JST) To: freebsd-hackers@freebsd.org Subject: Re: Search a symbol in the source tree From: Tetsuro Teddy FURUYA (=?iso-2022-jp?B?GyRCOEVDKxsoQiAbJEJFL086GyhC?=) In-Reply-To: Your message of "Mon, 18 Oct 1999 00:39:44 +0900" <19991018003944T.tfuruya@galois.tf.or.jp> References: <19991018003944T.tfuruya@galois.tf.or.jp> X-Mailer: Mew version 1.93 on Emacs 19.28 / Mule 2.3 (SUETSUMUHANA) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <19991020024218T.tfuruya@galois.tf.or.jp> Date: Wed, 20 Oct 1999 02:42:18 +0900 X-Dispatcher: imput version 980905(IM100) Lines: 79 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Probably, my mail did not reach freebsd-hackers mailing list because of absense of inreply-to headers. So, I will resend. ------------------------------------------------------------ Message-ID: <001301bf192c$18daa160$0533a8c0@dilemma.tf.or.jp> From: "Teddy" To: "Greg Lehey" , Cc: , , Subject: RE: Search a symbol in the source tree Date: Mon, 18 Oct 1999 14:45:08 +0900 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Thank you for replying to me. -----Original Message----- Greg Lehey ; n@nectar.com CC : zzhang@cs.binghamton.edu ; freebsd-hackers@freebsd.org ; nectar@nectar.com Re: Search a symbol in the source tree >> 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> > $find . -name "*.c" -print -exec "egrep" "-i" "idt" {} \; | less >> n> > Here , "idt" is a search string. >> n> That's because no one wants a separate invocation of egrep for >> n> every file! >> ^^^^^^ >> Probably, except me ! > >And why do you want it? Do you have too much time on your hands? I think that if we do not know old-fashed methods , we can not appreciate the goodcharacteristics of the various methods such as xargs, glimpse, grep with -R option, and global. Now, I have started to use full.exe from cygnus-b20, and its grep does not have -R option. Fortunately it has xargs, so I can utilize both of xargs and find at the same time. But, at this circumstance, we have to pay attention to the fact that xargs can not work well all the time. When seeing manpage xargs(1), they say, > Undefined behavior may occur if utility reads from the standard input. (I don't know there exists such a case really.) And, there might exist find -exec option in the older scripts. So, -exec option of the command find is still usefull and very important. If the user don't like the listing of the umatched file name at such circumstances, he/she might execute find like, find /usr/src/sys -name "*" -and -exec grep "-ia" idt {} \; -print | less or, find /usr/src/sys -name "*" -exec grep "-ia" idt {} \; -print | less As for me, when I began to use find at the first time, the find was rather difficult to use. But now it is amusing. Teddy Furuya To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message