home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Trees / V6 / usr / man / man1 / diff.1 < prev    next >
Encoding:
Text File  |  1975-06-26  |  2.0 KB  |  103 lines

  1. .th DIFF I 5/15/74
  2. .sh NAME
  3. diff \*- differential file comparator
  4. .sh SYNOPSIS
  5. .bd diff
  6. [
  7. .bd \*-
  8. ] name1 name2
  9. .sh DESCRIPTION
  10. .it Diff
  11. tells what lines must be changed in two files to bring them
  12. into agreement.
  13. The normal output contains lines of these forms:
  14. .s3
  15. .lp +5 0
  16. .it n1
  17. a
  18. .it n3,n4
  19. .br
  20. .it n1,n2
  21. d
  22. .it n3
  23. .br
  24. .it n1,n2
  25. c
  26. .it n3,n4
  27. .s3
  28. .i0
  29. These lines resemble
  30. .it ed
  31. commands to convert file
  32. .it name1
  33. into file
  34. .it name2.
  35. The numbers after the letters pertain to file
  36. .it name2.
  37. In fact, by exchanging `a' for `d' and reading backward
  38. one may ascertain equally how to convert file 
  39. .it name2
  40. into
  41. .it name1.
  42. As in 
  43. .it ed,
  44. identical pairs where
  45. .it n1
  46. =
  47. .it n2
  48. or
  49. .it n3
  50. =
  51. .it n4
  52. are abbreviated as a single number.
  53. .s3
  54. Following each of these lines come all the lines that are
  55. affected in the first file flagged by `*', 
  56. then all the lines that are affected in the second file
  57. flagged by `\fB.\fR'.
  58. .s3
  59. Under the \fB\*-\fR option,
  60. the output of
  61. .it diff
  62. is a script of
  63. .it "a, c"
  64. and 
  65. .it d
  66. commands for the editor
  67. .it ed,
  68. which will change the contents of the first file
  69. into the contents of the second.
  70. In this connection, the following shell program may help maintain
  71. multiple versions of a file.
  72. Only an ancestral file ($1) and a chain of 
  73. version-to-version
  74. .it ed
  75. scripts ($2,$3,...) made by
  76. .it diff
  77. need be on hand.
  78. A `latest version' appears on
  79. the standard output.
  80. .s3
  81. .lp +5 0
  82. .tr ||
  83. (cat $2 ... $9; echo "1,$p") \*v ed \*- $1
  84. .s3
  85. .i0
  86. Except for occasional `jackpots',
  87. .it diff
  88. finds a smallest sufficient set of file
  89. differences.
  90. .sh "SEE ALSO"
  91. cmp (I), comm (I), ed (I)
  92. .sh DIAGNOSTICS
  93. `jackpot' \*- To speed things up, the program uses hashing.
  94. You have stumbled on a case where there is a chance that
  95. this has resulted in
  96. a difference being called where none actually existed.
  97. Sometimes reversing the order of files will make a
  98. jackpot go away.
  99. .sh BUGS
  100. Editing scripts produced under the
  101. \fB\*-\fR option are naive about
  102. creating lines consisting of a single `\fB.\fR'.
  103.