|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
> > 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
|
|