Merge commit '008b34be09d7b9c3e7a18d3ce9ef8b5c4f4ff8b8'
[unleashed.git] / share / man / man1 / sdiff.1
blob9212c1ecf4a69a24871a3aff3300e1306b7ce454
1 '\" te
2 .\"  Copyright 1989 AT&T  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
3 .\" 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.
4 .\" 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.
5 .\" 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]
6 .TH SDIFF 1 "Dec 20, 1996"
7 .SH NAME
8 sdiff \- print differences between two files side-by-side
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fBsdiff\fR [\fB-l\fR] [\fB-s\fR] [\fB-o\fR \fIoutput\fR] [\fB-w\fR \fIn\fR] \fIfilename1\fR \fIfilename2\fR
13 .fi
15 .SH DESCRIPTION
16 .sp
17 .LP
18 \fBsdiff\fR uses the output of the \fBdiff\fR command to produce a side-by-side
19 listing of two files indicating lines that are different. Lines of the two
20 files are printed with a blank gutter between them if the lines are identical,
21 a \fB<\fR in the gutter if the line appears only in \fIfilename1\fR, a \fB>\fR
22 in the gutter if the line appears only in \fIfilename2\fR, and a \fB|\fR for
23 lines that are different. (See the \fBEXAMPLES\fR section below.)
24 .SH OPTIONS
25 .sp
26 .ne 2
27 .na
28 \fB\fB-l\fR\fR
29 .ad
30 .RS 14n
31 Print only the left side of any lines that are identical.to
32 .RE
34 .sp
35 .ne 2
36 .na
37 \fB\fB-s\fR\fR
38 .ad
39 .RS 14n
40 Do not print identical lines.
41 .RE
43 .sp
44 .ne 2
45 .na
46 \fB\fB-o\fR\fI output\fR \fR
47 .ad
48 .RS 14n
49 Use the argument \fIoutput\fR as the name of a third file that is created as a
50 user-controlled merge of \fIfilename1\fR and \fIfilename2\fR. Identical lines
51 of \fIfilename1\fR and \fIfilename2\fR are copied to \fIoutput\fR. Sets of
52 differences, as produced by \fBdiff\fR, are printed; where a set of differences
53 share a common gutter character. After printing each set of differences,
54 \fBsdiff\fR prompts the user with a \fB%\fR and waits for one of the following
55 user-typed commands:
56 .sp
57 .ne 2
58 .na
59 \fB\fBl\fR\fR
60 .ad
61 .RS 7n
62 Append the left column to the output file.
63 .RE
65 .sp
66 .ne 2
67 .na
68 \fB\fBr\fR\fR
69 .ad
70 .RS 7n
71 Append the right column to the output file.
72 .RE
74 .sp
75 .ne 2
76 .na
77 \fB\fBs\fR\fR
78 .ad
79 .RS 7n
80 Turn on silent mode; do not print identical lines.
81 .RE
83 .sp
84 .ne 2
85 .na
86 \fB\fBv\fR\fR
87 .ad
88 .RS 7n
89 Turn off silent mode.
90 .RE
92 .sp
93 .ne 2
94 .na
95 \fB\fBe l\fR\fR
96 .ad
97 .RS 7n
98 Call the editor with the left column.
99 .RE
102 .ne 2
104 \fB\fBe r\fR\fR
106 .RS 7n
107 Call the editor with the right column.
111 .ne 2
113 \fB\fBe b\fR\fR
115 .RS 7n
116 Call the editor with the concatenation of left and right.
120 .ne 2
122 \fB\fBe\fR\fR
124 .RS 7n
125 Call the editor with a zero length file.
129 .ne 2
131 \fB\fBq\fR\fR
133 .RS 7n
134 Exit from the program.
137 On exit from the editor, the resulting file is concatenated to the end of the
138 \fIoutput\fR file.
142 .ne 2
144 \fB\fB-w\fR\fI n\fR \fR
146 .RS 14n
147 Use the argument \fIn\fR as the width of the output line. The default line
148 length is 130 characters.
151 .SH USAGE
154 See \fBlargefile\fR(5) for the description of the behavior of \fBsdiff\fR when
155 encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).
156 .SH EXAMPLES
158 \fBExample 1 \fRAn example of the \fBsdiff\fR command.
161 A sample output of \fBsdiff\fR follows.
164 .in +2
166 x   |   y
167 a       a
168 b   <
169 c   <
170 d       d
171     >   c
173 .in -2
176 .SH ENVIRONMENT VARIABLES
179 If any of the \fBLC_*\fR variables ( \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR,
180 \fBLC_TIME\fR, \fBLC_COLLATE\fR, \fBLC_NUMERIC\fR, and \fBLC_MONETARY\fR ) (see
181 \fBenviron\fR(5)) are not set in the environment, the operational behavior of
182 \fBsdiff\fR for each corresponding locale category is determined by the value
183 of the \fBLANG\fR environment variable.  If \fBLC_ALL\fR is set, its contents
184 are used to override both the \fBLANG\fR and the other \fBLC_*\fR variables.
185 If none of the above variables is set in the environment, the "C" locale
186 determines how \fBsdiff\fR behaves.
188 .ne 2
190 \fB\fBLC_CTYPE\fR \fR
192 .RS 13n
193 Determines how \fBsdiff\fR handles characters. When \fBLC_CTYPE\fR is set to a
194 valid value, \fBsdiff\fR can display and handle text and filenames containing
195 valid characters for that locale.
198 .SH ATTRIBUTES
201 See \fBattributes\fR(5) for descriptions of the following attributes:
206 box;
207 c | c
208 l | l .
209 ATTRIBUTE TYPE  ATTRIBUTE VALUE
211 CSI     Enabled
214 .SH SEE ALSO
217 \fBdiff\fR(1), \fBed\fR(1), \fBattributes\fR(5), \fBenviron\fR(5),
218 \fBlargefile\fR(5)