AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox AT&T UNIX™PC Unix System V Users Manual - tenox

01.01.2013 Views

DIFF ( 1) DIFF ( 1) -e producing a script of a, c and d commands for the editor ed, which will recreate file2 from filel . In connection with -e, the following shell program may help maintain multiple versions of a file. Only an ancestral file ($1) and a chain of version-to-version ed scripts ($2,$3, ... ) made by diff need be on hand. A 'latest version' appears on the standard output. (shift; cat $*; echo '1,$p ') I ed - $1 Extra commands are added to the output when comparing directories with -e, so that the result is a sh ( 1) script for converting text files which are common to the two directories from their state in dir 1 to their state in dir2. -f produces a script similar to that of -e, not useful with ed, and in the opposite order. -c produces a diff with lines of context. The default is to present 3 lines of context and may be changed, e.g to 10, by -clO. With -c the output format is modified slightly: the output beginning with identification of the files involved and their creation dates and then each change is separated by a line with a dozen *'s. The lines removed from filel are marked with '- '; those added to file2 are marked '+'. Lines which are changed from one file to the other are marked in both files with 'f'. -h does a fast, half-hearted job. It works only when changed stretches are short and well separated, but does work on files of unlimited length. -Dstring causes diff to create a merged version of filel and file2 on the standard output, with C preprocessor controls included so that a compilation of the result without defining string is equivalent to compiling filel, while defining string will yield file2. -b causes trailing blanks (spaces and tabs) to be ignored, and other strings of blanks to compare equal. FILES /tmp / d????? /usr/lib/diffh for -h /bin/pr SEE ALSO cmp( 1), cc( 1), comm(1), ed( 1), diff3( 1) DIAGNOSTICS Exit status is 0 for no differences, 1 for some, 2 for trouble. BUGS Editing scripts produced under the -e or -f option are naive about creating lines consisting of a single '.' - 2-

DIFF ( 1 ) DIFF ( 1) When comparing directories with the -b option specified, dif! first compares the files ala cmp, and then decides to run the diff algorithm if they are not equal. This may cause a small amount of spurious output if the files then turn out to be identical because the only differences are insignificant blank string differences. - 3-

DIFF ( 1) DIFF ( 1)<br />

-e producing a script of a, c and d commands for the editor<br />

ed, which will recreate file2 from filel . In connection<br />

with -e, the following shell program may help<br />

maintain multiple versions of a file. Only an ancestral<br />

file ($1) and a chain of version-to-version ed scripts<br />

($2,$3, ... ) made by diff need be on hand. A 'latest version'<br />

appears on the standard output.<br />

(shift; cat $*; echo '1,$p ') I ed - $1<br />

Extra commands are added to the output when comparing<br />

directories with -e, so that the result is a sh ( 1)<br />

script for converting text files which are common to the<br />

two directories from their state in dir 1 to their state in<br />

dir2.<br />

-f produces a script similar to that of -e, not useful with<br />

ed, and in the opposite order.<br />

-c produces a diff with lines of context. The default is to<br />

present 3 lines of context and may be changed, e.g to<br />

10, by -clO. With -c the output format is modified<br />

slightly: the output beginning with identification of the<br />

files involved and their creation dates and then each<br />

change is separated by a line with a dozen *'s. The<br />

lines removed from filel are marked with '- '; those<br />

added to file2 are marked '+'. Lines which are changed<br />

from one file to the other are marked in both files with<br />

'f'.<br />

-h does a fast, half-hearted job. It works only when<br />

changed stretches are short and well separated, but does<br />

work on files of unlimited length.<br />

-Dstring<br />

causes diff to create a merged version of filel and file2<br />

on the standard output, with C preprocessor controls<br />

included so that a compilation of the result without<br />

defining string is equivalent to compiling filel, while<br />

defining string will yield file2.<br />

-b causes trailing blanks (spaces and tabs) to be ignored,<br />

and other strings of blanks to compare equal.<br />

FILES<br />

/tmp / d?????<br />

/usr/lib/diffh for -h<br />

/bin/pr<br />

SEE ALSO<br />

cmp( 1), cc( 1), comm(1), ed( 1), diff3( 1)<br />

DIAGNOSTICS<br />

Exit status is 0 for no differences, 1 for some, 2 for trouble.<br />

BUGS<br />

Editing scripts produced under the -e or -f option are naive<br />

about creating lines consisting of a single '.'<br />

- 2-

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

Saved successfully!

Ooh no, something went wrong!