From owner-freebsd-hackers Mon Oct 18 0:21:52 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from ppp142151.asahi-net.or.jp (ppp142151.asahi-net.or.jp [202.213.142.151]) by hub.freebsd.org (Postfix) with ESMTP id BE48414A2D for ; Mon, 18 Oct 1999 00:21:45 -0700 (PDT) (envelope-from tfuruya@ppp142151.asahi-net.or.jp) Received: from dilemma (tf051005.tf.or.jp [192.168.51.5]) by galois.tf.or.jp (8.9.3/3.7W-Teddy-99050304) with SMTP id OAA05211; Mon, 18 Oct 1999 14:43:57 +0900 (JST) 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 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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