SysIII/usr/src/man/man1/sdiff.1

Compare this file to the similar file:
Show the results in this format:

.TH SDIFF 1
.SH NAME
sdiff \- side-by-side difference program
.SH SYNOPSIS
.B sdiff
[ options ... ]
file1 file2
.SH DESCRIPTION
.I Sdiff\^
uses the output of
.IR diff (1)
to produce a side-by-side listing of two files indicating those
lines that are different.
Each line of the two files is printed with a blank gutter between them
if the lines are identical, a
.B <
in the gutter
if the line only exists in
.IR file1 ,
a
.B >
in the gutter
if the line only exists in
.IR file2 ,
and a
.B |
for lines that are different.
.PP
For example:
.PP
.RS 11
.nf
	x	|	y
	a		a
	b	<
	c	<
	d		d
		>	c
.fi
.RE
.PP
The following options exist:
.TP 11
.BI \-w "  n\^"
Use the next argument,
.IR n ,
as the width of the output line.
The default line length is 130 characters.
.TP
.BR \-l
Only print the left side of any lines that are identical.
.TP
.BR \-s
Do not print identical lines.
.TP
.BI \-o "  output\^"
Use the next argument,
.IR output ,
as the name of a third file that is created as a user controlled merging
of 
.I file1\^
and
.IR file2 .
Identical lines of
.I file1\^
and
.I file2\^
are copied to 
.IR output .
Sets of differences, as produced by
.IR diff (1),
are printed; where a set of differences share a common gutter character.
After printing each set of differences,
.I sdiff\^
prompts the user with a
.B %
and waits for one of the following user-typed commands:
.PP
.RS 19
.TP
.B l
append the left column to the output file
.TP
.B r
append the right column to the output file
.TP
.B s
turn on silent mode; do not print identical lines
.TP
.B v
turn off silent mode
.TP
.B "e  l"
call the editor with the left column
.TP
.B "e  r"
call the editor with the right column
.TP
.B "e  b"
call the editor with the concatenation of left and right
.TP
.B e
call the editor with a zero length file
.TP
.B q
exit from the program
.RE
.sp .2i
.RS 11
On exit from the editor, the resulting file is concatenated on the end of the
.I output\^
file.
.RE
.SH SEE ALSO
diff(1), ed(1).