'\" te .\" Copyright 1989 AT&T Copyright (c) 1996, Sun Microsystems, Inc. All Rights Reserved .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] .TH sdiff 1 "20 Dec 1996" "SunOS 5.11" "User Commands" .SH NAME sdiff \- print differences between two files side-by-side .SH SYNOPSIS .LP .nf \fBsdiff\fR [\fB-l\fR] [\fB-s\fR] [\fB-o\fR \fIoutput\fR] [\fB-w\fR \fIn\fR] \fIfilename1\fR \fIfilename2\fR .fi .SH DESCRIPTION .sp .LP \fBsdiff\fR uses the output of the \fBdiff\fR 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 \fB<\fR in the gutter if the line appears only in \fIfilename1\fR, a \fB>\fR in the gutter if the line appears only in \fIfilename2\fR, and a \fB|\fR for lines that are different. (See the \fBEXAMPLES\fR section below.) .SH OPTIONS .sp .ne 2 .mk .na \fB\fB-l\fR\fR .ad .RS 14n .rt Print only the left side of any lines that are identical.to .RE .sp .ne 2 .mk .na \fB\fB-s\fR\fR .ad .RS 14n .rt Do not print identical lines. .RE .sp .ne 2 .mk .na \fB\fB-o\fR\fI output\fR \fR .ad .RS 14n .rt Use the argument \fIoutput\fR as the name of a third file that is created as a user-controlled merge of \fIfilename1\fR and \fIfilename2\fR. Identical lines of \fIfilename1\fR and \fIfilename2\fR are copied to \fIoutput\fR. Sets of differences, as produced by \fBdiff\fR, are printed; where a set of differences share a common gutter character. After printing each set of differences, \fBsdiff\fR prompts the user with a \fB%\fR and waits for one of the following user-typed commands: .sp .ne 2 .mk .na \fB\fBl\fR\fR .ad .RS 7n .rt Append the left column to the output file. .RE .sp .ne 2 .mk .na \fB\fBr\fR\fR .ad .RS 7n .rt Append the right column to the output file. .RE .sp .ne 2 .mk .na \fB\fBs\fR\fR .ad .RS 7n .rt Turn on silent mode; do not print identical lines. .RE .sp .ne 2 .mk .na \fB\fBv\fR\fR .ad .RS 7n .rt Turn off silent mode. .RE .sp .ne 2 .mk .na \fB\fBe l\fR\fR .ad .RS 7n .rt Call the editor with the left column. .RE .sp .ne 2 .mk .na \fB\fBe r\fR\fR .ad .RS 7n .rt Call the editor with the right column. .RE .sp .ne 2 .mk .na \fB\fBe b\fR\fR .ad .RS 7n .rt Call the editor with the concatenation of left and right. .RE .sp .ne 2 .mk .na \fB\fBe\fR\fR .ad .RS 7n .rt Call the editor with a zero length file. .RE .sp .ne 2 .mk .na \fB\fBq\fR\fR .ad .RS 7n .rt Exit from the program. .RE On exit from the editor, the resulting file is concatenated to the end of the \fIoutput\fR file. .RE .sp .ne 2 .mk .na \fB\fB-w\fR\fI n\fR \fR .ad .RS 14n .rt Use the argument \fIn\fR as the width of the output line. The default line length is 130 characters. .RE .SH USAGE .sp .LP See \fBlargefile\fR(5) for the description of the behavior of \fBsdiff\fR when encountering files greater than or equal to 2 Gbyte ( 2^31 bytes). .SH EXAMPLES .LP \fBExample 1 \fRAn example of the \fBsdiff\fR command. .sp .LP A sample output of \fBsdiff\fR follows. .sp .in +2 .nf x | y a a b < c < d d > c .fi .in -2 .sp .SH ENVIRONMENT VARIABLES .sp .LP If any of the \fBLC_*\fR variables ( \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, \fBLC_TIME\fR, \fBLC_COLLATE\fR, \fBLC_NUMERIC\fR, and \fBLC_MONETARY\fR ) (see \fBenviron\fR(5)) are not set in the environment, the operational behavior of \fBsdiff\fR for each corresponding locale category is determined by the value of the \fBLANG\fR environment variable. If \fBLC_ALL\fR is set, its contents are used to override both the \fBLANG\fR and the other \fBLC_*\fR variables. If none of the above variables is set in the environment, the "C" locale determines how \fBsdiff\fR behaves. .sp .ne 2 .mk .na \fB\fBLC_CTYPE\fR \fR .ad .RS 13n .rt Determines how \fBsdiff\fR handles characters. When \fBLC_CTYPE\fR is set to a valid value, \fBsdiff\fR can display and handle text and filenames containing valid characters for that locale. .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS tab() box; lw(2.75i) lw(2.75i) lw(2.75i) lw(2.75i) . \fBATTRIBUTE TYPE\fR\fBATTRIBUTE VALUE\fR CSIEnabled .TE .SH SEE ALSO .sp .LP \fBdiff\fR(1), \fBed\fR(1), \fBattributes\fR(5), \fBenviron\fR(5), \fBlargefile\fR(5)