multi level diff using find



I'm trying to diff files in different directories, but I don't want to
diff everything. The compiler produces subdirectories like debugger,
unshared, and profiled. I don't care what's in them, or if the .o
files are different. So far I've gotten this far:

export SRC=query_E
export TGT=query_D

find $SRC -name debugger -prune \
-o -name unshared -prune \
-o -name profiled -prune \
-o -name '*.c' -exec diff '{}' `echo {} | tr $SRC $TGT` \;

I don't know why tr isn't substituting $SRC for $TGT at all. It just
creates "diff query_E/... query_E/..."

What am I doing wrong?
I looked at someone else's solution which had an exec as follows:
-exec diff '{" $TGT
The problem is if find goes down more than 1 level, it will not match
$TGT anymore.

Thanks,
Craig
.



Relevant Pages

  • RE: How do I set meld as the default diff viewer for ubuntu updates?
    ... How do I set meld as the default diff viewer for ... this amazing graphical diff tool called ... I'm given a rather useless menu IMHO ... [Diff files in a more friendly format] ...
    (Ubuntu)
  • Re: Compare two large directories?
    ... > had a similar newer seagate drive fail recently. ... > might not care about the apparently 'lost' ones, ... diff new old>diff ... nfiles data1; nfiles data2 ...
    (alt.os.linux.suse)
  • Re: multi level diff using find
    ... diff everything. ... I don't know why tr isn't substituting $SRC for $TGT at all. ... echo | tr E D ... so your find command is ...
    (comp.unix.shell)
  • Re: bringing ee up to date
    ... of "lpr", and even at least one wrong path. ... diff the version we have with the same version of the vendor ... diff the vendor src of the version of what we have with the ... Even if someone doesn't care what the world thinks ...
    (freebsd-hackers)
  • Re: Prototypes/Parameters to a Function/Sub-Routine
    ... It is usually an indication of a design error if a method has to ... care about the class an object comes from. ... In this case diff() needs to be able to ensure that the object passed ...
    (comp.lang.perl.misc)