diff(1) | diff(1) |
Output format similar to | |
Do a fast, | |
| well separated, but can be used on ®les of unlimited length. |
| Create a merged version of ®le1 and ®le2 on the standard output, with C preprocessor con- |
| trols included so that a compilation of the result without de®ning string is equivalent to com- |
| piling ®le1, while compiling the result with string de®ned is equivalent to compiling ®le2. |
Ignore trailing blanks (spaces and tabs) and treat other strings of blanks as equal. | |
Ignore all whitespace (blanks and tabs). For example, if ( a == b ) and if(a==b) | |
| are treated as equal. |
Ignores uppercase/lowercase differences. Thus A is treated the same as a. | |
Expand tabs in output lines. Normal or | |
| of each line. Resulting misalignment of indentation in the original source lines can make the |
| output listing dif®cult to interpret. This option preserves original source ®le indentation. |
EXTERNAL INFLUENCES
Environment Variables
LANG determines the locale to use for the locale categories when both LC_ALL and the corresponding environment variable (beginning with LC_) do not specify a locale. If LANG is not set or is set to the empty string, a default of "C" (see lang(5)) is used.
LC_CTYPE determines the space characters for the diff command, and the interpretation of text within ®le as single- and/or
LC_MESSAGES determines the language in which messages are displayed.
If any internationalization variable contains an invalid setting, diff and diffh behave as if all internationalization variables are set to "C". See environ(5).
International Code Set Support
Single- and
RETURN VALUE
Upon completion, diff returns with one of the following exit values:
0No differences were found.
1Differences were found.
>1 An error occurred.
EXAMPLES
The following command creates a script ®le script:
diff
w is added to the end of the script in order to save the ®le:
echo w >> script
The script ®le can then be used to create the ®le x2 from the ®le x1 using the editor ed in the following manner:
ed x1 < script
The following command produces the difference output with 2 lines of context information before and after the line that was different:
diff
The following command ignores all blanks and tabs and ignores
diff
d
− 2 − | Section 1−179 |