home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / u_man / cat1 / diff.z / diff
Encoding:
Text File  |  1998-10-20  |  12.2 KB  |  265 lines

  1.  
  2.  
  3.  
  4. DDDDIIIIFFFFFFFF((((1111))))                                                                DDDDIIIIFFFFFFFF((((1111))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      diff - differential file and directory comparator
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ddddiiiiffffffff [----llllrrrrssss] [----SSSS_n_a_m_e] [----cccceeeeffffhhhhnnnn] [----xxxx_p_a_t] [----bbbbiiiiwwwwtttt] dir1 dir2
  13.      ddddiiiiffffffff [----cccceeeeffffhhhhnnnn] [----bbbbiiiiwwwwtttt] file1 file2
  14.      ddddiiiiffffffff [----DDDD_s_t_r_i_n_g] [----bbbbiiiiwwww] file1 file2
  15.      GNU diff options:
  16.      ddddiiiiffffffff [----####] [----aaaaBBBBddddHHHHNNNNppppqqqqTTTTuuuuvvvv] [----CCCC_n_u_m] [----FFFF_e_x_p] [----IIII_e_x_p] [----LLLL_l_a_b]
  17.  
  18. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  19.      If both arguments are directories, _d_i_f_f sorts the contents of the
  20.      directories by name, and then runs the regular file _d_i_f_f algorithm
  21.      (described below) on text files which are different.  Binary files which
  22.      differ (unless ----aaaa is specified), common subdirectories, and files which
  23.      appear in only one directory are listed.  Options when comparing
  24.      directories are:
  25.  
  26.      ----llll   long output format; each text file _d_i_f_f is piped through _p_r(1) to
  27.           paginate it, other differences are remembered and summarized after
  28.           all text file differences are reported.
  29.  
  30.      ----rrrr   causes application of _d_i_f_f recursively to common subdirectories
  31.           encountered.
  32.  
  33.      ----ssss   causes _d_i_f_f to report files which are the same, which are otherwise
  34.           not mentioned.
  35.  
  36.      ----SSSS_n_a_m_e
  37.           starts a directory _d_i_f_f in the middle beginning with file _n_a_m_e.
  38.  
  39.      ----xxxx_p_a_t
  40.           adds _p_a_t to a list of regular expressions.  There can be several
  41.           ----xxxx_p_a_t options.  Any directory or file (base) name matching one of
  42.           the patterns is skipped.  The special characters available in the
  43.           pattern _p_a_t are similar to those used in _e_g_r_e_p(1).  For example, the
  44.           following command will ignore all "hidden" files and all RCS
  45.           archives:
  46.  
  47.                    diff -r '-x^\.' '-x,v$' foo bar
  48.  
  49.      When run on regular files, and when comparing text files which differ
  50.      during directory comparison, _d_i_f_f tells what lines must be changed in the
  51.      files to bring them into agreement.  Except in rare circumstances, _d_i_f_f
  52.      finds a smallest sufficient set of file differences.  If neither _f_i_l_e_1
  53.      nor _f_i_l_e_2 is a directory, then either may be given as `-', in which case
  54.      the standard input is used.  If _f_i_l_e_1 is a directory, then a file in that
  55.      directory whose file-name is the same as the file-name of _f_i_l_e_2 is used
  56.      (and vice versa).  If both _f_i_l_e_1 and _f_i_l_e_2 are directories, then files
  57.      (or files and directories with ----rrrr) with identical names are compared.
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. DDDDIIIIFFFFFFFF((((1111))))                                                                DDDDIIIIFFFFFFFF((((1111))))
  71.  
  72.  
  73.  
  74.      There are several options for output format; the default output format
  75.      contains lines of these forms:
  76.  
  77.           _n_1 a _n_3,_n_4
  78.           _n_1,_n_2 d _n_3
  79.           _n_1,_n_2 c _n_3,_n_4
  80.  
  81.      These lines resemble _e_d commands to convert _f_i_l_e_1 into _f_i_l_e_2.  The
  82.      numbers after the letters pertain to _f_i_l_e_2.  In fact, by exchanging `a'
  83.      for `d' and reading backward one may ascertain equally how to convert
  84.      _f_i_l_e_2 into _f_i_l_e_1.  As in _e_d, identical pairs where _n_1 = _n_2 or _n_3 = _n_4 are
  85.      abbreviated as a single number.
  86.  
  87.      Following each of these lines come all the lines that are affected in the
  88.      first file flagged by `<', then all the lines that are affected in the
  89.      second file flagged by `>'.
  90.  
  91.      Except for ----bbbb,,,, ----wwww,,,, ----iiii or ----tttt which may be given with any of the others,
  92.      the following options are mutually exclusive:
  93.  
  94.      ----eeee       produces a script of _a, _c and _d commands for the editor _e_d,
  95.               which will recreate _f_i_l_e_2 from _f_i_l_e_1.  In connection with ----eeee,
  96.               the following shell program may help maintain multiple versions
  97.               of a file.  Only an ancestral file ($1) and a chain of version-
  98.               to-version _e_d scripts ($2,$3,...) made by _d_i_f_f need be on hand.
  99.               A `latest version' appears on the standard output.
  100.  
  101.                       (shift; cat $*; echo '1,$p') | ed - $1
  102.  
  103.               Extra commands are added to the output when comparing
  104.               directories with ----eeee,,,, so that the result is a _s_h(1) script for
  105.               converting text files which are common to the two directories
  106.               from their state in _d_i_r_1 to their state in _d_i_r_2.
  107.  
  108.      ----ffff       produces a script similar to that of ----eeee,,,, not useful with _e_d, and
  109.               in the opposite order.
  110.  
  111.      ----nnnn       produces a script similar to that of ----eeee,,,, but in the opposite
  112.               order and with a count of changed lines on each insert or delete
  113.               command.  This is the form used by the RCS commands for storing
  114.               a revision change.
  115.  
  116.      ----cccc       produces a diff with 3 lines of context.  Use the ----CCCC_n_u_m option
  117.               to specify the number of lines.  With ----cccc the output format is
  118.               modified slightly:  the output beginning with identification of
  119.               the files involved and their creation dates and then each change
  120.               is separated by a line with a dozen *'s.  The lines removed from
  121.               _f_i_l_e_1 are marked with `- '; those added to _f_i_l_e_2 are marked `+
  122.               '.  Lines which are changed from one file to the other are
  123.               marked in both files with `! '.
  124.  
  125.               Changes which lie within <context> lines of each other are
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. DDDDIIIIFFFFFFFF((((1111))))                                                                DDDDIIIIFFFFFFFF((((1111))))
  137.  
  138.  
  139.  
  140.               grouped together on output.
  141.  
  142.      ----hhhh       has no affect. It is present for compatibility with _o_d_i_f_f(1).
  143.  
  144.      ----DDDD_s_t_r_i_n_g causes _d_i_f_f to create a merged version of _f_i_l_e_1 and _f_i_l_e_2 on the
  145.               standard output, with C preprocessor controls included so that a
  146.               compilation of the result without defining _s_t_r_i_n_g is equivalent
  147.               to compiling _f_i_l_e_1, while defining _s_t_r_i_n_g will yield _f_i_l_e_2.
  148.  
  149.      ----bbbb       causes trailing blanks (spaces and tabs) to be ignored, and
  150.               other strings of blanks to compare equal.
  151.  
  152.      ----wwww       is similar to ----bbbb but causes whitespace (blanks and tabs) to be
  153.               totally ignored.  E.g., ``if ( a == b )'' will compare equal to
  154.               ``if(a==b)''.
  155.  
  156.      ----iiii       ignores the case of letters.  E.g., ``A'' will compare equal to
  157.               ``a''.
  158.  
  159.      ----tttt       will expand tabs in output lines.  Normal or ----cccc output adds
  160.               character(s) to the front of each line which may foul up the
  161.               indentation of the original source lines and make the output
  162.               listing difficult to interpret.  This option will preserve the
  163.               original source's indentation.
  164.  
  165. GGGGNNNNUUUU DDDDIIIIFFFFFFFF OOOOPPPPTTTTIIIIOOOONNNNSSSS
  166.      ----#       Show # lines (an integer) of context.  This option does not
  167.               specify an output format by itself; it has no effect unless it
  168.               is combined with ----cccc or ----uuuu.
  169.  
  170.      ----aaaa       Treat all files as text and compare them line-by-line, even if
  171.               they do not appear to be text
  172.  
  173.      ----BBBB       Ignore changes that just insert or delete blank lines.
  174.  
  175.      ----CCCC_n_u_m    Use the context output format, showing _l_i_n_e_s (an integer) lines
  176.               of context
  177.  
  178.      ----dddd       Change the algorithm to find a guaranteed minimal set of
  179.               changes.  This makes diff slower (sometimes much slower).
  180.  
  181.      ----FFFF_e_x_p    In context and unified format, for each hunk of differences,
  182.               show some of the last preceding line that matches _e_x_p.
  183.  
  184.      ----HHHH       Use heuristics to speed handling of large files that have
  185.               numerous scattered small changes
  186.  
  187.      ----IIII_e_x_p    Ignore changes that just insert or delete lines that match _e_x_p.
  188.  
  189.      ----LLLL_l_a_b    Use _l_a_b instead of the pathname in the context format and
  190.               unified format headers
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. DDDDIIIIFFFFFFFF((((1111))))                                                                DDDDIIIIFFFFFFFF((((1111))))
  203.  
  204.  
  205.  
  206.      ----NNNN       In directory comparison, if a file is found in only one
  207.               directory, treat it as present but empty in the other directory.
  208.  
  209.      ----pppp       Show which C function each change is in.
  210.  
  211.      ----qqqq       Report only whether the files differ, not the details of the
  212.               differences.
  213.  
  214.      ----TTTT       Output a tab rather than a space before the text of a line in
  215.               normal or context format.  This causes the alignment of tabs in
  216.               the line to look normal.
  217.  
  218.      ----uuuu       Use the unified output format
  219.  
  220.      ----vvvv       Display the version string.
  221.  
  222. FFFFIIIILLLLEEEESSSS
  223.      /usr/bin/odiff    executable for _o_d_i_f_f.
  224.      /bin/diff         executable for GNU derived _d_i_f_f.
  225.      /bin/pr           executed by the ----llll option.
  226.  
  227. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  228.      bdiff(1), cc(1), cmp(1), comm(1), odiff(1), diff3(1), ed(1),
  229.      DIFFsource(5)
  230.  
  231. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  232.      Exit status is 0 for no differences, 1 for some differences, 2 for
  233.      trouble.
  234.  
  235. PPPPEEEERRRRFFFFOOOORRRRMMMMAAAANNNNCCCCEEEE
  236.      The GNU derived _d_i_f_f and older BSD derived _o_d_i_f_f use different
  237.      algorithms.  If the two files to be compared fit in main memory, then
  238.      _d_i_f_f is faster, but if they don't fit, _d_i_f_f can cause severe paging.  The
  239.      _o_d_i_f_f algorithm uses a small, fixed amount of memory even on large files.
  240.      The multiple pass algorithm of _o_d_i_f_f is up to two or three times slower
  241.      than _d_i_f_f, on files that fit in memory, but can be many times faster on
  242.      files that don't fit.
  243.  
  244.      The _d_i_f_f command automatically invokes the _o_d_i_f_f (searching for _o_d_i_f_f
  245.      along $$$$PPPPAAAATTTTHHHH) on files that have a combined size larger than one-fourth of
  246.      memory size, if no GNU specific _d_i_f_f options were specified.  If that
  247.      fails, then _d_i_f_f silently does the work itself.
  248.  
  249.      You can force either variant: specifying -_H always gets _d_i_f_f, specifying
  250.      _o_d_i_f_f always gets _o_d_i_f_f.
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.