Michael C. Toren on Sun, 13 Oct 2002 01:21:21 -0400


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] list by owner


> > 	find /foo -type f \( -name \*.sh -o -name \*.pl \) \
> > 		-exec echo {} \; -exec grep -C gtar {} \;
> 
> Surely, you meant:
> 
>   find /foo -type f \( -name \*.sh -o -name \*.pl \) \
>     -exec echo {} >2 \; -print0 | xargs -0 grep -C gtar

The problem is that find's -exec flag doesn't pass the remaining
arguments through /bin/sh, so none of the shell metacharacters are
going to be interpreted:

	[mct@quint ~]$ touch foo
	[mct@quint ~]$ find foo -exec echo {} '>&2' \;
	foo >&2

-mct