-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdirdiff
More file actions
executable file
·34 lines (33 loc) · 989 Bytes
/
dirdiff
File metadata and controls
executable file
·34 lines (33 loc) · 989 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/tcsh
#
# Diff the source files from $1 and $2.
# Ignores .o, *~ singleton
if( -e diffz ) rm diffz
if( "$1" == "" || "$2" == "" ) then
echo "dirdiff <dir1> <dir2> <outname = diffz>"
exit
endif
set outname = diffz
if ( "$3" != "" ) set outname = "$3"
if( -e tmp90210 ) rm tmp90210
if( -e tmp90210b ) rm tmp90210b
if( -e $outname ) then
echo "Output file $outname exists"
exit
endif
diff -r --brief --exclude=".hg" --exclude=".svn" --exclude="*.o" --exclude="singleton.mod" "$1" "$2" |& tee tmp90210
touch $outname
foreach i ("^Common" "^Only" "^Files")
#echo "=============" $i
#grep $i tmp90210 |& tee -a $outname
grep $i tmp90210 >> $outname
grep -v $i tmp90210 > tmp90210b
mv tmp90210b tmp90210
end
#sed -e 's,^Files\(.*\) and \(.*\) differ,diff -wc \1 \2 | less,' $outname > tmp90210b
sed -e 's,^Files\(.*\) and \(.*\) differ,vimdiff \1 \2,' $outname > tmp90210b
mv tmp90210b $outname
cat tmp90210 >> $outname
rm tmp90210
vim $outname
#end