4.3BSD beta release manual page
[unix-history] / usr / src / usr.bin / diff / diff3 / diff3.sh
CommitLineData
46356827
BS
1#! /bin/sh
2#
3# diff3.sh 4.1 83/02/10
4#
5e=
6case $1 in
7-*)
8 e=$1
9 shift;;
10esac
11if test $# = 3 -a -f $1 -a -f $2 -a -f $3
12then
13 :
14else
15 echo usage: diff3 file1 file2 file3 1>&2
16 exit
17fi
18trap "rm -f /tmp/d3[ab]$$" 0 1 2 13 15
19diff $1 $3 >/tmp/d3a$$
20diff $2 $3 >/tmp/d3b$$
21/usr/lib/diff3 $e /tmp/d3[ab]$$ $1 $2 $3