Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!purdue!iuvax!rutgers!dptg!att!cbnewsl!ams From: ams@cbnewsl.ATT.COM (andrew.m.shaw) Newsgroups: comp.unix.wizards Subject: Re: recursive grep Message-ID: <1590@cbnewsl.ATT.COM> Date: 23 Aug 89 17:22:34 GMT References: <13710@polyslo.CalPoly.EDU> Reply-To: ams@cbnewsl.ATT.COM (andrew.m.shaw,580,) Organization: AT&T Bell Laboratories Lines: 13 >>Here is a short quicky (I hope). I am trying to do the following: >> >>find . -type d -exec grep string {}/* \; >...why not do this: > > find . -type f -exec grep string {} \; > No, find does not expand {} unless isolated. Why not use the the much ignored xargs and save yourself n execs of grep? Thus: find . -type f -print | xargs grep string