Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!uc!cs.umn.edu!ub.d.umn.edu!rutgers!gatech!prism!gt0178a From: gt0178a@prism.gatech.EDU (Jim Burns) Newsgroups: comp.unix.shell Subject: Re: csh args Message-ID: <15547@hydra.gatech.EDU> Date: 20 Oct 90 13:15:15 GMT References: <4864@crystal1.UUCP> Distribution: comp Organization: Georgia Institute of Technology Lines: 26 in article <4864@crystal1.UUCP>, mostek@motcid.UUCP (Frank B. Mostek) says: > Other things I would like to do would be to only "print" the files that grep > finds a pattern in, and pipe the grep into more. > The following alias does not work: > alias sea 'find \!:1 -name "\!:2" -print -exec grep \!:3 {} | more \;' Move the '\;' to the other side of the '|': alias sea 'find \!:1 -name "\!:2" -print -exec grep \!:3 {} \; | more ' This, however, only works for explicit filenames. To use (quoted) wildcard characters, add an 'eval' and some extra '\'s: alias sea 'eval find \!:1 -name \"\!:2\" -print -exec grep \!:3 {} \\\; | more' Then 'sea subdir \* pat' will work. The '-print' causes *every* filename to be printed out. Without it, you can only get the filenames for matching files printed out with 'xargs' or a for loop, ala P.J.Falstad's suggestions. -- BURNS,JIM Georgia Institute of Technology, Box 30178, Atlanta Georgia, 30332 uucp: ...!{decvax,hplabs,ncar,purdue,rutgers}!gatech!prism!gt0178a Internet: gt0178a@prism.gatech.edu