Small shell tools for text editing
|
Line-by-Line Comparisons
With diff you can determine content differences between files. Table 17 shows some of the options. You can also use the program to verify identical files. Some of the functions are similar to those for join . The exit code for identical documents is 0 . If the documents are different, the tool will exit with 1 .
Compare the a.txt and c.txt files, for example. Figure 10 shows some of the possible options you can use. The first example shows the differences one at a time. The 1d0 entry and others are editor commands that I won't be covering here. The second example shows the results in columns. The third example shows the "silent" execution and exit codes.
Conclusion
Many shell helpers can supplement or replace sed, and they can help you automate many of the text-processing tasks you need to perform.
Infos
- Files used in this article: ftp://ftp.linux-magazine.com/pub/listings/ubuntu-user.com/25/TextTools/
Buy this article as PDF
Pages: 1
(incl. VAT)