'\"macro stdmacro
.if n .pH g1.sdiff @(#)sdiff	40.3 of 10/10/89
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} sdiff 1 "Directory and File Management Utilities" "\&"
.if \nX=1 .ds x} sdiff 1 "Directory and File Management Utilities"
.if \nX=2 .ds x} sdiff 1 "" "\&"
.if \nX=3 .ds x} sdiff "" "" "\&"
.TH \*(x}
.SH NAME
\f4sdiff\f1 \- print file differences side-by-side
.SH SYNOPSIS
\f4sdiff\f1
[
.I options
]
.I file1
.I file2
.SH DESCRIPTION
\f4sdiff\fP
uses the output of the
\f4diff\fP command
to produce a side-by-side listing of two files indicating
lines that are different.
Lines of the two files are printed with a blank gutter between them
if the lines are identical, a
\f4<\f1
in the gutter
if the line appears only in
.IR file1 ,
a
\f4>\f1
in the gutter
if the line appears only in
.IR file2 ,
and a
\f4|\f1
for lines that are different.
For example:
.PP
.RS 11
.nf
.ft 4
	x	|	y
	a		a
	b	<
	c	<
	d		d
		>	c
.ft 1
.fi
.RE
.PP
Valid options are:
.TP 11
\f4\-w\f2  n\^\f1
Use the argument
.I n 
as the width of the output line.
The default line length is 130 characters.
.TP
\f4\-l\f1
Print only the left side of any lines that are identical.
.TP
\f4\-s\f1
Do not print identical lines.
.TP
\f4\-o\f2  output\^\f1
Use the argument
.I output
as the name of a third file that is created as
a user-controlled merge 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
\f4diff\fP,
are printed; where a set of differences share a common gutter character.
After printing each set of differences,
\f4sdiff\fP
prompts the user with a
\f4%\f1
and waits for one of the following user-typed commands:
.PP
.RS 15
.PD 0
.TP
\f4l\f1
Append the left column to the output file.
.TP
\f4r\f1
Append the right column to the output file.
.TP
\f4s\f1
Turn on silent mode; do not print identical lines.
.TP
\f4v\f1
Turn off silent mode.
.TP
\f4e l\f1
Call the editor with the left column.
.TP
\f4e r\f1
Call the editor with the right column.
.TP
\f4e b\f1
Call the editor with the concatenation of left and right.
.TP
\f4e\f1
Call the editor with a zero length file.
.TP
\f4q\f1
Exit from the program.
.RE
.PD
.IP "" 11
On exit from the editor, the resulting file is concatenated to the end of the
.I output\^
file.
.PD
.SH SEE ALSO
\f4diff\fP(1), \f4ed\fP(1).
