Hi, I have the following task: there are two directories and some of files
in them differ. I try to show a list of files which differ it in the
following way:
> find dir1 -exec diff -q "{}" dir2/`basename {}` \;
or
> find dir1 -exec sh -c "diff -q {} dir2/`basename {}`" \;

but for some reason basename doesn't strip the dir1 prefix from the file
names, e.g. for
> find dir1 -exec echo `basename {}` \;
it just shows all the files as dir1/file1... .
Only
> find dir1 -exec basename {} \;
shows them correctly stripped of the directory name.

Has someone an idea why this happens?

Regards,
Andreas

Reply via email to