Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Oct 1999 14:45:08 +0900
From:      "Teddy" <tfuruya@ppp142151.asahi-net.or.jp>
To:        "Greg Lehey" <grog@lemis.com>, <n@nectar.com>
Cc:        <zzhang@cs.binghamton.edu>, <freebsd-hackers@freebsd.org>, <nectar@nectar.com>
Subject:   RE: Search a symbol in the source tree
Message-ID:  <001301bf192c$18daa160$0533a8c0@dilemma.tf.or.jp>

next in thread | raw e-mail | index | archive | help
Thank you for replying to me.

-----Original Message-----
Greg Lehey <grog@lemis.com>
<ht5t-fry@asahi-net.or.jp>; n@nectar.com <n@nectar.com>
CC : zzhang@cs.binghamton.edu <zzhang@cs.binghamton.edu>;
freebsd-hackers@freebsd.org <freebsd-hackers@freebsd.org>; nectar@nectar.com
<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?=) <ht5t-fry@asahi-net.or.jp>
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 <ht5t-fry@asahi-net.or.jp>




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?001301bf192c$18daa160$0533a8c0>