

diff                         Command                         diff




Summarize differences between two files

ddiiffff [-bbddeeffhh] [-cc _s_y_m_b_o_l] _f_i_l_e_1 _f_i_l_e_2

diff compares file1 with file2, and prints a summary of the chan-
ges needed to turn file1 into file2.

Two options  involve input file specification.   First, the stan-
dard input  may be  specified in  place of a  file by  entering a
hyphen `-'  in place of  file1 or file2.   Second, if file1  is a
directory, diff  looks within that directory for  a file that has
the same name as  file2, then compares file2 with the file of the
same name in directory file1.

The default output script has lines in the following format:


        1,2 c 3,4


The numbers 1,2 refer to line  ranges in file1, and 3,4 to ranges
in file2.   The range  is abbreviated to  a single number  if the
first number is the same as the second.  The command c was chosen
from among  the ed commands `aa', `cc', and  `dd'.  diff then prints
the text from each of  the two files.  Text associated with file1
is  preceded  by  `< ', whereas  text  associated  with file2  is
preceded by `>'.

The following summarizes diff's options.

-bb Ignore trailing blanks and treat more than one blank in an in-
   put line as a single blank.  Spaces and tabs are considered to
   be blanks for this comparison.

-cc _s_y_m_b_o_l
   Produce output suitable for the C preprocessor cpp; the output
   contains #iiffddeeff, #iiffnnddeeff, #eellssee,  and #eennddiiff lines.  symbol is
   the string used to build the #ifdef statements.  If you define
   symbol to the C preprocessor cpp, it will produce file2 as its
   output; otherwise,  it will  produce file1.  This  option does
   _n_o_t  work  for files  that  already  contain #iiffddeeff,  #iiffnnddeeff,
   #eellssee, and #eennddiiff statements.

-ee Create an ed script that will convert file1 into file2.

-ff Produce a script in the same manner as the -e option, but with
   line numbers  taken directly from  the two input  files.  This
   will work  properly only if applied from  end to beginning; it
   cannot be used directly by ed.

-hh Compare large files that have a minimal number of differences.
   This  option uses  an algorithm  that is  not limited  by file
   length, but may not discover all differences.



COHERENT Lexicon                                           Page 1




diff                         Command                         diff



-dd  Select the  -h algorithm  only for  files larger  than 25,000
   bytes; otherwise, use the normal algorithm.

***** See Also *****

ed, egrep, commands

***** Diagnostics *****

diff's exit status is zero when the files are identical, one when
they are  different, and two if a  problem was encountered (e.g.,
could not open a file).

***** Notes *****

diff cannot  handle files with  more than 32,000  lines.  Handing
diff a file  that exceeds that limit will cause  it to fail, with
unpredictable side effects.







































COHERENT Lexicon                                           Page 2


