diff -ur d1 d2 | grep -v "^Only" On Sat, 2003-01-25 at 03:49, Robert P. J. Day wrote: > > > i don't see in the man page for "diff" how to (cleanly) do > the following for recursive directory comparisons: > > dir "d1": original, pristine, source directory > dir "d2": test build directory > > assume dir "d1" is the original, cleaned source directory, > and that "d2" is a build directory in which i'm making tweaks > to the occasional source file, then rebuilding (which generates > numerous .o files, a.out files, etc. in "d2"). > > when i'm happy, i want to generate a unified diff which shows > only the changes from any original files to their new versions: > > $ diff ... options ... d1 d2 > > however, i want all extraneous files in d2 (.o, a.out) to be > ignored *completely* -- only files that exist in both dirs > should generate diff output. > > as it is, if i use > > $ diff -ur d1 d2 > > i will still get output of the form > > Only in d2: a.out > Only in d2: foo.o > Only in d2: bar.o > > if the file is not in d1, i don't want *any* output. the above > messages don't even go to stderr, so i can't 2> /dev/null. (and > yes, i could "grep -v", but i'm looking for a diff option that > says something like, "Ignore files that exist only in second > directory.") > > is there such an option? am i just overlooking something in the > man page? surely this can't be that hard. or can it? > > rday > > > > -- > redhat-list mailing list > unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe > https://listman.redhat.com/mailman/listinfo/redhat-list >
-- redhat-list mailing list unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe https://listman.redhat.com/mailman/listinfo/redhat-list