Paul Jarc wrote:
>>> find dir1 -exec diff -q "{}" dir2/`basename {}` \;
>
> Here, the command substitution is expanded by the shell before find
> runs. basename sees the literal argument {}, and so it outputs {},
> and find sees dir2/{}.
>
>>> find dir1 -exec sh -c "diff -q {} dir2/`basename {}`
Paul Jarc wrote:
>>> find dir1 -exec diff -q "{}" dir2/`basename {}` \;
>
> Here, the command substitution is expanded by the shell before find
> runs. basename sees the literal argument {}, and so it outputs {},
> and find sees dir2/{}.
>
>>> find dir1 -exec sh -c "diff -q {} dir2/`basename {}`"
"Andreas R." <[EMAIL PROTECTED]> wrote:
> find dir1 -type f -exec sh -c 'echo "{}" dir2/"`basename "{}"`"' \;
> it works, but I still don't understand completely why it works.
Actually, it still won't work in some cases. If a filename contains a
double quote, like 'foo" "bar', the shell will se