SDIF(1) SDIF(1)
NAME
sdif - sdiff clone
SYNOPSIS
sdif [-n] [-l] [-s] [-[fF]] [-b] [-i] [-w] [-w width] [-c]
[file1 [file2]]
sdif [-rcs] [-q] [-rrev1 [-rrev2]] [sdif options] file
DESCRIPTION
Sdif is a clone program of System V sdiff(1) command. The
basic feature of sdif and sdiff is making a side-by-side
listing of two different files. It makes much easier to
compare two files than looking at the normal diff output.
All contents of two files a listed on left and right
sides. Center column is used to indicate how different
the line. No mark means there is no difference. The line
only included in left file is indicated by `<' mark, and
`>' is used to lines only in right file. Modified line
has a mark `|'. Example output from sdif is like this:
1 deleted <
2 same 1 same
3 changed | 2 modified
4 same 3 same
> 4 added
Sdif has some incompatibilities with sdiff. Negative
incompatibility is a lack of -o option and expanding all
tabs to spaces. Other incompatibilities are:
o line numbering
o folding a long line
o context diff support
o unified diff support
o option to keep diff mark
o handle backspace and caridge return
o default width is 80
o rcs support
o cdif (word context diff) support
o read diff data from file or stdin
OPTIONS
-w width
Use width as a width of output listing. Default
width is 80. Original sdiff has a default value
130 but nobody uses 132 column line printer in
these days. If the standard error is to a termi-
nal, the width of that terminal is taken as a out-
put width if possible.
-l Print only left column if the line is identical.
1992/12/11 (v1.14) 1
SDIF(1) SDIF(1)
-s Silent. No output for identical lines. Reading
diff output from file or stdin put this switch on
automatically.
-n Print line number on each lines.
-f Fold the line if it is longer than printing width.
Folded line is indicated by `+' mark at top of the
line. No continue mark is printed when numbering
option is on.
-F Fold longs line at word boundaries.
-m Usually diff mark from diff output are trimed off.
This option forces to leave them on output listing.
I prefer to use this option with -c.
-rcs, -rrev
Use rcsdiff instead of normal diff. Option -rcs is
not required when -rrev is supplied.
-cdif Use cdif command instead of normal diff command.
-b, -w, -c, -u, -B
Passed through to the back-end diff command. Sdif
can process the output from context diff (-c) and
unified diff (-u) if those are available. Option
-B is valid only for cdif.
RELATED COMMANDS
a2ps is a command which converts ascii text to
postscript program. C version was originally
posted to usenet by miguel@imag.imag.fr (Miguel
Santana). I reimplemented it by perl and enhanced
to use different font family for overstruck and
underlined characters. This is a convenient tool
to print the output from sdif to postscript
printer.
cdif is a program which post-processes normal diff out-
put and highlights deleted, changed and added word
on modified line. It uses overstiking to high-
lighting. Sdif can handle there sequence cor-
rectly. Cdif has to be installed to use -cdif
option with sdif.
Next is a example that I'm using often.
sdif -cdif -w180 file1 file2 | a2ps -w
All of these programs can be ftp'ed from sra.co.jp
(133.137.4.3) by anonymous ftp from the directory
~ftp/pub/lang/perl/sra-scripts.
1992/12/11 (v1.14) 2
SDIF(1) SDIF(1)
AUTHOR
Kazumasa Utashiro <utashiro@sra.co.jp>
Software Research Associates, Inc., Japan
SEE ALSO
perl(1), diff(1), cdif(1), a2ps(1)
1992/12/11 (v1.14) 3