xref: /minix3/usr.bin/sdiff/sdiff.1 (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc.\" $NetBSD: sdiff.1,v 1.4 2014/03/18 18:20:45 riastradh Exp $
2ce982eb7SThomas Cort.\" $OpenBSD: sdiff.1,v 1.11 2007/02/22 02:50:56 ray Exp $
3ce982eb7SThomas Cort.\"
4ce982eb7SThomas Cort.\" Written by Raymond Lai <ray@cyth.net>.
5ce982eb7SThomas Cort.\" Public domain.
6ce982eb7SThomas Cort.\"
7ce982eb7SThomas Cort.Dd February 21, 2007
8ce982eb7SThomas Cort.Dt SDIFF 1
9ce982eb7SThomas Cort.Os
10ce982eb7SThomas Cort.Sh NAME
11ce982eb7SThomas Cort.Nm sdiff
12ce982eb7SThomas Cort.Nd side-by-side diff
13ce982eb7SThomas Cort.Sh SYNOPSIS
14ce982eb7SThomas Cort.Nm
15ce982eb7SThomas Cort.Op Fl abdilstW
16ce982eb7SThomas Cort.Op Fl I Ar regexp
17ce982eb7SThomas Cort.Op Fl o Ar outfile
18ce982eb7SThomas Cort.Op Fl w Ar width
19ce982eb7SThomas Cort.Ar file1
20ce982eb7SThomas Cort.Ar file2
21ce982eb7SThomas Cort.Sh DESCRIPTION
22ce982eb7SThomas Cort.Nm
23ce982eb7SThomas Cortdisplays two files side by side,
24ce982eb7SThomas Cortwith any differences between the two highlighted as follows:
25ce982eb7SThomas Cortnew lines are marked with
26ce982eb7SThomas Cort.Sq \*[Gt] ;
27ce982eb7SThomas Cortdeleted lines are marked with
28ce982eb7SThomas Cort.Sq \*[Lt] ;
29ce982eb7SThomas Cortand changed lines are marked with
30ce982eb7SThomas Cort.Sq | .
31ce982eb7SThomas Cort.Pp
32ce982eb7SThomas Cort.Nm
33ce982eb7SThomas Cortcan also be used to interactively merge two files,
34ce982eb7SThomas Cortprompting at each set of differences.
35ce982eb7SThomas CortSee the
36ce982eb7SThomas Cort.Fl o
37ce982eb7SThomas Cortoption for an explanation.
38ce982eb7SThomas Cort.Pp
39ce982eb7SThomas CortThe options are:
40ce982eb7SThomas Cort.Bl -tag -width Ds
41ce982eb7SThomas Cort.It Fl l
42ce982eb7SThomas CortOnly print the left column for identical lines.
43ce982eb7SThomas Cort.It Fl o Ar outfile
44ce982eb7SThomas CortInteractively merge
45ce982eb7SThomas Cort.Ar file1
46ce982eb7SThomas Cortand
47ce982eb7SThomas Cort.Ar file2
48ce982eb7SThomas Cortinto
49ce982eb7SThomas Cort.Ar outfile .
50ce982eb7SThomas CortIn this mode, the user is prompted for each set of differences.
51ce982eb7SThomas CortSee
52ce982eb7SThomas Cort.Ev EDITOR
53ce982eb7SThomas Cortand
54ce982eb7SThomas Cort.Ev VISUAL ,
55ce982eb7SThomas Cortbelow,
56ce982eb7SThomas Cortfor details of which editor, if any, is invoked.
57ce982eb7SThomas Cort.Pp
58ce982eb7SThomas CortThe commands are as follows:
59ce982eb7SThomas Cort.Bl -tag -width Ds
60ce982eb7SThomas Cort.It Cm l
61ce982eb7SThomas CortChoose left set of diffs.
62ce982eb7SThomas Cort.It Cm r
63ce982eb7SThomas CortChoose right set of diffs.
64ce982eb7SThomas Cort.It Cm s
65ce982eb7SThomas CortSilent mode \(en identical lines are not printed.
66ce982eb7SThomas Cort.It Cm v
67ce982eb7SThomas CortVerbose mode \(en identical lines are printed.
68ce982eb7SThomas Cort.It Cm e
69ce982eb7SThomas CortStart editing an empty file, which will be merged into
70ce982eb7SThomas Cort.Ar outfile
71ce982eb7SThomas Cortupon exiting the editor.
72ce982eb7SThomas Cort.It Cm e Cm l
73ce982eb7SThomas CortStart editing file with left set of diffs.
74ce982eb7SThomas Cort.It Cm e Cm r
75ce982eb7SThomas CortStart editing file with right set of diffs.
76ce982eb7SThomas Cort.It Cm e Cm b
77ce982eb7SThomas CortStart editing file with both sets of diffs.
78ce982eb7SThomas Cort.It Cm q
79ce982eb7SThomas CortQuit
80ce982eb7SThomas Cort.Nm .
81ce982eb7SThomas Cort.El
82ce982eb7SThomas Cort.It Fl s
83ce982eb7SThomas CortSkip identical lines.
84ce982eb7SThomas Cort.It Fl w Ar width
85ce982eb7SThomas CortPrint a maximum of
86ce982eb7SThomas Cort.Ar width
87ce982eb7SThomas Cortcharacters on each line.
88ce982eb7SThomas CortThe default is 130 characters.
89ce982eb7SThomas Cort.El
90ce982eb7SThomas Cort.Pp
91ce982eb7SThomas CortOptions passed to
92ce982eb7SThomas Cort.Xr diff 1
93ce982eb7SThomas Cortare:
94ce982eb7SThomas Cort.Bl -tag -width Ds
95ce982eb7SThomas Cort.It Fl a
96ce982eb7SThomas CortTreat
97ce982eb7SThomas Cort.Ar file1
98ce982eb7SThomas Cortand
99ce982eb7SThomas Cort.Ar file2
100ce982eb7SThomas Cortas text files.
101ce982eb7SThomas Cort.It Fl b
102ce982eb7SThomas CortIgnore trailing blank spaces.
103ce982eb7SThomas Cort.It Fl d
104ce982eb7SThomas CortMinimize diff size.
105ce982eb7SThomas Cort.It Fl I Ar regexp
106ce982eb7SThomas CortIgnore line changes matching
107ce982eb7SThomas Cort.Ar regexp .
108ce982eb7SThomas CortAll lines in the change must match
109ce982eb7SThomas Cort.Ar regexp
110ce982eb7SThomas Cortfor the change to be ignored.
111ce982eb7SThomas Cort.It Fl i
112ce982eb7SThomas CortDo a case-insensitive comparison.
113ce982eb7SThomas Cort.It Fl t
114ce982eb7SThomas CortExpand tabs to spaces.
115ce982eb7SThomas Cort.It Fl W
116ce982eb7SThomas CortIgnore all spaces
117ce982eb7SThomas Cort(the
118ce982eb7SThomas Cort.Fl w
119ce982eb7SThomas Cortflag is passed to
120ce982eb7SThomas Cort.Xr diff 1 ) .
121ce982eb7SThomas Cort.El
122ce982eb7SThomas Cort.Sh ENVIRONMENT
123ce982eb7SThomas Cort.Bl -tag -width Ds
124ce982eb7SThomas Cort.It Ev EDITOR , VISUAL
125ce982eb7SThomas CortSpecifies an editor to use with the
126ce982eb7SThomas Cort.Fl o
127ce982eb7SThomas Cortoption.
128ce982eb7SThomas CortIf both
129ce982eb7SThomas Cort.Ev EDITOR
130ce982eb7SThomas Cortand
131ce982eb7SThomas Cort.Ev VISUAL
132ce982eb7SThomas Cortare set,
133ce982eb7SThomas Cort.Ev VISUAL
134ce982eb7SThomas Corttakes precedence.
135ce982eb7SThomas CortIf neither
136ce982eb7SThomas Cort.Ev EDITOR
137ce982eb7SThomas Cortnor
138ce982eb7SThomas Cort.Ev VISUAL
139ce982eb7SThomas Cortare set,
140ce982eb7SThomas Cortthe default is
141ce982eb7SThomas Cort.Xr vi 1 .
142ce982eb7SThomas Cort.It Ev TMPDIR
143ce982eb7SThomas CortSpecifies a directory for temporary files to be created.
144ce982eb7SThomas CortThe default is
145ce982eb7SThomas Cort.Pa /tmp .
146ce982eb7SThomas Cort.El
147ce982eb7SThomas Cort.Sh SEE ALSO
148ce982eb7SThomas Cort.Xr diff 1 ,
149ce982eb7SThomas Cort.Xr diff3 1 ,
150ce982eb7SThomas Cort.Xr vi 1 ,
151ce982eb7SThomas Cort.Xr re_format 7
152ce982eb7SThomas Cort.Sh AUTHORS
153ce982eb7SThomas Cort.Nm
154ce982eb7SThomas Cortwas written from scratch for the public domain by
15584d9c625SLionel Sambuc.An Ray Lai Aq Mt ray@cyth.net .
156ce982eb7SThomas Cort.Sh CAVEATS
157ce982eb7SThomas CortAlthough undocumented,
158ce982eb7SThomas Cort.Nm
159ce982eb7SThomas Cortsupports all options supported by GNU sdiff.
160ce982eb7SThomas CortSome options require GNU diff.
161ce982eb7SThomas Cort.Pp
162ce982eb7SThomas CortTabs are treated as anywhere from one to eight characters wide,
163ce982eb7SThomas Cortdepending on the current column.
164ce982eb7SThomas CortTerminals that treat tabs as eight characters wide will look best.
165ce982eb7SThomas Cort.Sh BUGS
166ce982eb7SThomas Cort.Nm
167ce982eb7SThomas Cortmay not work with binary data.
168