The diff command reads in two text files and
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.
diff = "diff" s filename s filename s
filename s ["ABORT"]
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.
diff aborts with a severe error if the log file cannot be opened or
created for appending.
An ordinary error is generated if either or both of the input files
cannot be opened.
If, at the end of the run, the two input files have not been proven to
be identical, and the ABORT keyword is present, diff returns severe
diff returns success status if none of the above conditions (or similar
conditions) occur, even if the two files are different.
The diff command
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
http://www.ross.net/funnelweb/reference/commands_diff.html (1 of 2) [3/3/2000 10:44:36 PM]