MPE/iX Shell and Utilities Reference Manual, Vol 1

diff(1) MPE/iX Shell and Utilities diff(1)
NAME
diff, diffh, bdiff — compare two text files and show differences
SYNOPSIS
diff [–befHhimnrstw][–C n][–c[n]] [–Difname] path1 path2
diffh [–befimnrstw][–C n][–c[n]] [–Difname] path1 path2
bdiff [–befimnrstw][–C n][–c[n]] [–Difname] path1 path2 [n]
DESCRIPTION
The diff command attempts to determine the minimal set of changes needed to convert a file
named path1 into path2.
If either (but only one) file name is , diff reads from standard input. If exactly one of
path1 or path2 is a directory, diff uses a file in that directory with the same name as the
other file name. If both are directories, diff compares files with the same file names under
the two directories; however, it does not compare files in subdirectories unless you specify the
–r option. When comparing two directories, diff does not compare block special files,
character special files, or
FIFO special files to any other files and does not compare regular files
to directories.
By default, output consists of descriptions of the changes in a style reminiscent of the ed text
editor. A line indicating the type of change is given. The three types are a (append), d
(delete), and c (change). The output is symmetric in the sense that a delete in path1 is the
counterpart of an append in path2. diff prefixes each operation with a line number (or
range) in path1 and suffixes each with a line number (or range) in path2. After the line giving
the type of change, diff displays the deleted or added lines, prefixing lines from path1 with
< and lines from path2 with >.
When you call the command as diffh, it automatically uses the –h option.
When you call it as bdiff, diff computes the differences in chunks of n lines (default
3999). This lets you process arbitrarily large files and generally produces less output than the
–h option.
Options
diff accepts the following options:
–b ignores white space preceding the newline at the end of each line and considers
strings of white space elsewhere in input lines to be equivalent. For example if one
file contained a string of three spaces and a tab at a given location while the other file
contained a string of two spaces at the same location, diff would not report this as a
difference.
1-174 Commands and Utilities