Basic Diff question

MC rossiya at gmail.com
Mon Sep 18 22:26:31 PDT 2006


Thanks for the quick replies.  They got me to thinking and I whipped up this
little bach script that seems equal to the task:

virtual7:/usr/ports/math/ffff # cat diffOMatic.sh
#Takes two arguments which are old/ and new/ respectively
diffOMatic() { ( cd $1/; find . -type f ) | while read f; do
#echo $f
if [ -f "$2/$f" ]; then
cp -n $1/$f "$2/$f".orig
( cd $2/; diff --ignore-all-space -u "$f".orig $f; )
rm "$2/$f".orig
fi;
done
}

diffOMatic work/FFFF323-src/ FFFF323-src/

Output compared well to a straight dirr -rn /old/  new/, however it doesn't
[yet] handle the case of missing files.


More information about the freebsd-ports mailing list