File:  [MW Coherent from dump] / coherent / d / bin / diff / diff3.sh
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Wed May 29 04:56:39 2019 UTC (7 years, 1 month ago) by root
Branches: MarkWilliams, MAIN
CVS tags: relic, HEAD
coherent

: /bin/diff3 4/3/91
: Usage: diff3 [ -ex3 ] file1 file2 file3
: Run two diffs, then merge their results.

FLAGS=
PID=$$
TMP=/tmp/d3${PID}
TMPA=${TMP}a
TMPB=${TMP}b

case "$1" in
-* )
	FLAGS=$1
	shift
esac

case $# in
3)
	;;
*)
	echo Usage: diff3 [-ex3] file1 file2 file3
	exit 2
esac

trap "rm $TMPA $TMPB; exit 2" 1 2 3 5

diff -d $1 $3 >$TMPA

case $? in
[01])
	diff -d $2 $3 >$TMPB
	;;
*)
	rm $TMPA
	exit 2
esac

case $? in
[01])
	/usr/lib/diff3 $FLAGS $TMP
esac

STATUS=$?
rm $TMPA $TMPB
exit $STATUS

: end of /bin/diff3

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.