home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


UNIX Power Tools

UNIX Power ToolsSearch this book
Previous: 28.7 diff for Very Long Files: bdiff Chapter 28
Comparing Files
Next: 28.9 ex Scripts Built by diff
 

28.8 More Friendly diff Output

ediff
If you find the output of the diff ( 28.1 ) program to be hard to follow, try using the ediff program to filter diff output into something more readable. For example, the diff program might produce the following output:

% 

diff chapter2 chapter2.new


i22,26d21
< Use the bc program to convert from decimal to hexadecimal.
< To do so, use the obase command to set the base for output:
<
<       obase=16
<
39c34,35
< See Section 5.6 for more examples of using bc.
--
> See Section 5.6 for information on how to use the bc command to
> convert decimal to hexadecimal.

This is a little hard to follow until you get used to the format. Now try filtering the output through ediff :

% 

diff chapter2 chapter2.new | ediff



---- 5 lines deleted at 22:
Use the bc program to convert decimal to hexadecimal.
To do so, use the obase command to set the base for output:

        obase=16

---- 1 line changed to 2 lines at 39 from:
See Section 5.6 for more examples of using bc.
---- to:
See Section 5.6 for information on how to use the bc command to
convert decimal to hexadecimal.

Now you see why ediff describes itself as a " diff to English translator."

- LM


Previous: 28.7 diff for Very Long Files: bdiff UNIX Power Tools Next: 28.9 ex Scripts Built by diff
28.7 diff for Very Long Files: bdiff Book Index 28.9 ex Scripts Built by diff

The UNIX CD Bookshelf Navigation The UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System