csh args

Jim Burns gt0178a at prism.gatech.EDU
Sat Oct 20 23:15:15 AEST 1990


in article <4864 at crystal1.UUCP>, mostek at 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 at prism.gatech.edu



More information about the Comp.unix.shell mailing list