The diff command reads in two text files and appends a report to a log file containing a list of the differences between the two input files. If the log file does not already exist, an empty one is created first.
Syntax : diff = "diff" s filename s filename s filename s ["ABORT"] Examples: diff result.tex answer.tex diff.log diff $Otest23.out $Atest23.out $Ldiff.log ABORT
The diff command performs a full line-based differences operation. It will identify different sections in a file, even if they are of differing length.
The implementation of the diff command is quite complicated. To be sure that it is at least getting its same/different proclamation right, the diff command performs a binary comparison as an extra check.
The following points describe the rules for determining the result status.
The diff command appends its differences report rather than merely writing it. This allows a regression test script to perform a series of regression tests and produce a report for the user.
The diff command was added to the shell after it had become apparent that the simpler compare command was not yielding enough information. Whereas early on, regression testing was treated mainly as a tool to ensure that FunnelWeb was being ported to other machines correctly, it began to place an increasing role during development in identifying the effects of changes made to the code. The diff command supports this application of regression testing by pinpointing the differences between nearly-identical text files.
Webmaster Copyright © Ross N. Williams 1992,1999. All rights reserved.