Chapter 14: Using 3rd Party Common Tools

diff

Step 4 Click the Run button.

Using Diff - Command Line Options

diff [ -rebidtvo? ] [-O <colors>] oldfile newfile

If diff is given two directories, it will diff each of the files in those directories.

If diff is given two binary files, it will compare them and issue a report if they are different.

If diff is given the -r option, it will recursively diff each of the files in each subdirectory.

If diff is given the -e option, it will output a script suitable for feeding into EDLIN to update oldfile to create newfile.

Otherwise, diff outputs lines of the form:

n1 a n3,n4

n1,n2 d n3

n1,n2 c n3,n4

where 'a' means: add lines n3 thru n4 from newfile at location n1 in newfile; 'd' means: delete

lines n1 thru n2 from newfile, next line is n3 in newfile; and 'c' means: change lines n1 thru n2 in newfile to lines n3 thru n4 in newfile Identical pairs where n1=n2 or n3=n4 are abbreviated as a single number. Following each of the [adc] lines comes each of the lines effected. Lines preceded by '<' are from oldfile, those preceded by '>' are from newfile.

The options for Diff are:

-b: Ignore trailing whitespace and treat sequences of embedded whitespace as being equal.

-i: Ignore leading whitespace.

-d: Treat files as if they were binary, only reporting if they are different.

-t: Treat files as if they were text, even if default autodetection claims they are binary.

-v: Report on each file that it processes, not just the ones with differences.

-o: Colorize output with the default colors (black, white, light cyan, and yellow), just as '-O 0fbe' would.

-O <colors>: Colorize output with the specified single-character hex colors: background, normal

text, old text, and new text. The colors are: black = 0, blue = 1, green = 2, cyan = 3, red = 4, magenta = 5, brown = 6, lightgray = 7, darkgray = 8, lightblue = 9, lightgreen = A, lightcyan = B, lightred = C, lightmagenta = D, yellow = E, white = F.

-?: Display program description.

Cisco Support Tools User Guide for Cisco Unified Software Release 2.1(1)

205

Page 219
Image 219
Cisco Systems 2.1(1) manual Using Diff Command Line Options, 205