Current File : //bin/diffmk
#!/usr/bin/sh
#
#	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
#	  All Rights Reserved


#! /usr/bin/sh

# Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.

#     Makefile for echo

PATH=/usr/bin
if test -z "$3" -o "$3" = "$1" -o "$3" = "$2"; then
	echo `gettext SUNW_OST_OSCMD "usage: diffmk name1 name2 name3 -- name3 must be different"` >&2
	exit 2
fi
diff -e $1 $2 | (sed -n -e '
/[ac]$/{
	p
	a\
.mc |
: loop
	n
	/^\.$/b done1
	p
	b loop
: done1
	a\
.mc\
.
	b
}

/d$/{
	s/d/c/p
	a\
.mc *\
.mc\
.
	b
}'; echo '1,$p') | ed - $1| sed -e '
/^\.TS/,/.*\. *$/b pos
/^\.T&/,/.*\. *$/b pos
p
d
:pos
/^\.mc/d
' > $3