tailieunhanh - Linux programming unleash phần 2

bởi những người sáng tạo và bảo trì của EGCS. Một loạt rất lớn của các biên tập viên đứng cùng với các vi Spartan và rất xấu và phức tạp kỳ diệu của emacs. Thúc đẩy chủ yếu bởi hạt nhân Linux, thư viện C GNU đã phát triển đáng kể rằng một phiên bản mới, glibc (còn được biết đến như là libc6) đã nổi lên như thư viện C chuẩn. | The Linux Programming Toolkit 86 Part I Programmers often need to quickly identify differences between two files or to merge two files together. The GNU project s diff and patch programs provide these facilities. The first part of this chapter shows you how to create diffs files that express the differences between two source code files. The second part illustrates using diffs to create source code patches in an automatic fashion. Comparing Files The diff command is one of a suite of commands that compares files. It is the one on which we will focus but first we briefly introduce the cmp command. Then we cover the other two commands diff3 and sdiff in the following sections. Understanding the cmp Command The cmp command compares two files showing the offset and line numbers where they differ. Optionally cmp displays differing characters side-by-side. Invoke cmp as follows cmp options filel file2 A hyphen - may be substituted for filel or file2 so cmp may be used in a pipeline. If one filename is omitted cmp assumes standard input. The options include the following -c --print-chars Print the first characters encountered that differ -I N --ignore-initial N Ignore any difference encountered in the first N bytes -l --verbose Print the offsets of differing characters in decimal format and the their values in octal format -s --silent --quiet Suppress all output returning only an exit code. 0 means no difference 1 means one or more differences 2 means an error occurred. -v --version Print cmp s version information From a programmer s perspective cmp is not terribly useful. Listings and show two versions of Proverbs 3 verses 5 and 6. The acronyms JPS and NIV stand for Jewish Publication Society and New International Version respectively. Listing JPS Version of Proverbs 3 5-6 Trust in the Lord with all your heart And do not rely on your own understanding. In all your ways acknowledge Him And He will make your paths smooth. 87 Comparing and Merging Source Files .

TỪ KHÓA LIÊN QUAN