|
|
1.1 root 1:
2: set -xv
3: :
4: : 'Diff3 - run two diffs, then merge their'
5: : 'results'
6: :
7: unique=$$
8:
9: case "$1" in
10: -* )
11: flag=$1
12: shift
13: esac
14:
15: case $# in
16: 3)
17: f1mark=$1;f2mark=$3;;
18: 5)
19: f1mark=$4;f2mark=$5;;
20: *)
21: echo Usage: diff3 [-ex3EX] file1 file2 file3 [m1 m2]
22: exit 2
23: esac
24:
25: trap 'rm /tmp/d3${unique}[ab]; exit 2' 1 2 3 5
26:
27: diff -d -n $1 $3 >/tmp/d3${unique}a
28:
29: case $? in
30: [01])
31: diff -d -n $2 $3 >/tmp/d3${unique}b
32: ;;
33:
34: *)
35: rm /tmp/d3${unique}[ab]
36: exit 2
37: esac
38:
39: case $? in
40: [01])
41: /usr/lib/diff3 $flag /tmp/d3${unique} $f1mark $f2mark
42: : diff3 $flag /tmp/d3${unique} $f1mark $f2mark
43: esac
44:
45: stat=$?
46:
47: rm /tmp/d3${unique}[ab]
48: exit $stat
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.