16.12.2012 Views

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

diff<br />

Description<br />

Options<br />

The diff command attempts to determine the minimal set of changes needed to<br />

convert a file whose name is specified by the path1 argument into the file specified<br />

by the path2 argument.<br />

Input files must be text files. If either (but only one) filename is –, diff uses a copy<br />

of the standard input (stdin) for that file. If exactly one of path1 or path2 is a<br />

directory, diff uses a file in that directory with the same name as the other filename.<br />

If both are directories, diff compares files with the same filenames under the two<br />

directories; however, it does not compare files in subdirectories unless you specify<br />

the –r option. When comparing two directories, diff does not compare character<br />

special files, or FIFO special files with any other files.<br />

By default, output consists of descriptions of the changes in a style like that of the<br />

ed text editor. A line indicating the type of change is given. The three types are a<br />

(append), d (delete), and c (change). The output is symmetric: A delete in path1 is<br />

the counterpart of an append in path2. diff prefixes each operation with a line<br />

number (or range) in path1 and suffixes each with a line number (or range) in<br />

path2. After the line giving the type of change, diff displays the deleted or added<br />

lines, prefixing lines from path1 with < and lines from path2 with >.<br />

Options that control the output or style of file comparison are:<br />

–b Ignores trailing blanks and tabs and considers adjacent groups of blanks<br />

and tabs elsewhere in input lines to be equivalent.<br />

For example, if one file contained a string of three spaces and a tab at a<br />

given location while the other file contained a string of two spaces at the<br />

same location, diff would not report this as a difference.<br />

–C n Shows n lines of context before and after each change. diff marks lines<br />

removed from path1 with –, lines added to path2 with +, and lines changed<br />

in both files with !.<br />

–c[n] Is equivalent to –Cn, but n is optional. The default value for n is 3. diff<br />

marks lines removed from path1 with –, lines added to path2 with +, and<br />

lines changed in both files with !.<br />

–Difname<br />

Displays output that is the appropriate input to the C preprocessor to<br />

generate the contents of path2 when ifname is defined, and the contents of<br />

path1 when ifname is not defined.<br />

–e Writes out a script of commands for the ed text editor, which converts path1<br />

to path2. diff sends the output to the standard output (stdout).<br />

–f Writes a script to stdout (but it will be in a form not suitable for use with the<br />

ed editor) showing the modifications necessary to convert path1 to path2 in<br />

the reverse order of that produced by the –e option. The commands<br />

produced will be reversed from that produced by –e, and the line number<br />

ranges will be separated by spaces, rather than commas. This option<br />

conflicts with the –m option.<br />

–H Uses the half-hearted (–h) algorithm only if the normal algorithm runs out of<br />

system resources.<br />

–h Uses a fast, half-hearted algorithm instead of the normal diff algorithm. This<br />

236 z/<strong>OS</strong> <strong>V1R9.0</strong> <strong>UNIX</strong> <strong>System</strong> <strong>Services</strong> <strong>Command</strong> Reference

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!