One problem you might be tempted to tackle with is sorting out the mess that can happen if two people make copies of the same file, and then make changes to their copies. You often find that one version has some things right and another version has other things right. What if you wanted to compile a single version of this document that reflects the changes made to each copy? You want to select which version is correct for each set of differences. An effective way to do this would be to use . (Of course, the best thing to do is to prevent the problem in the first place, by using .)
One of the most powerful uses of sdiff is to
build an output file by interactively choosing between different versions of
To do this, you have to specify the -o option and the name of an
output file to be created.
The sdiff command then
% prompt after each set of differences.
You can compare the different versions and select
the one that will be sent to the output file.
Some of the possible responses are
choose the left column,
r to choose the right column,
q to exit the program.