version 2, including all changes.
.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
CMP |
|
|
2 |
!!!CMP |
|
|
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
DESCRIPTION |
|
|
6 |
BYTE RANGES |
|
|
7 |
NOTES |
|
|
8 |
DIAGNOSTICS |
|
|
9 |
SEE ALSO |
|
|
10 |
STANDARDS |
|
|
11 |
---- |
|
|
12 |
!!NAME |
|
|
13 |
|
|
|
14 |
|
|
|
15 |
cmp (GNU diffutils) - compare two files or byte ranges |
|
|
16 |
!!SYNOPSIS |
|
|
17 |
|
|
|
18 |
|
|
|
19 |
__cmp__ [[-clsv] [[-i NUM] [[--help] [[--print-chars] |
|
|
20 |
[[--ignore-initial=NUM] [[--verbose] [[--quiet] [[--silent] |
|
|
21 |
[[--version] -I FILE1 [[FILE2 [[RANGE1 [[RANGE2]]] |
|
|
22 |
!!DESCRIPTION |
|
|
23 |
|
|
|
24 |
|
|
|
25 |
The __cmp__ utility compares two files of any type and |
|
|
26 |
writes the results to the standard output. By default, |
|
|
27 |
__cmp__ is silent if the files are the same; if they |
|
|
28 |
differ, the byte and line number at which the first |
|
|
29 |
difference occurred is reported. |
|
|
30 |
|
|
|
31 |
|
|
|
32 |
In the output, bytes and lines are numbered beginning with |
|
|
33 |
one; however, range inputs are zero-based; see below for |
|
|
34 |
details. A filename of ''-'' represents standard |
|
|
35 |
input. |
|
|
36 |
|
|
|
37 |
|
|
|
38 |
The following options are available: |
|
|
39 |
|
|
|
40 |
|
|
|
41 |
__-c, --print-chars__ |
|
|
42 |
|
|
|
43 |
|
|
|
44 |
Output the differing bytes as characters, rather than as |
|
|
45 |
octal numbers. Non-printable characters will be shown in |
|
|
46 |
form. |
|
|
47 |
|
|
|
48 |
|
|
|
49 |
__-i NUM, --ignore-initial=NUM__ |
|
|
50 |
|
|
|
51 |
|
|
|
52 |
Ignore ''NUM'' initial characters from each file. This is |
|
|
53 |
a synonym for specifying ''NUM NUM'' as the two |
|
|
54 |
''RANGE'' arguments. |
|
|
55 |
|
|
|
56 |
|
|
|
57 |
__-l, --verbose__ |
|
|
58 |
|
|
|
59 |
|
|
|
60 |
Print the byte number (decimal) and the differing byte |
|
|
61 |
values (octal) for each difference. |
|
|
62 |
|
|
|
63 |
|
|
|
64 |
__-s, --quiet, --silent__ |
|
|
65 |
|
|
|
66 |
|
|
|
67 |
Print nothing for differing files; return exit status |
|
|
68 |
only. |
|
|
69 |
|
|
|
70 |
|
|
|
71 |
__-v, --version__ |
|
|
72 |
|
|
|
73 |
|
|
|
74 |
Print the __diffutils__ version number. |
|
|
75 |
!!BYTE RANGES |
|
|
76 |
|
|
|
77 |
|
|
|
78 |
The two optional arguments ''RANGE1'' and ''RANGE2'' |
|
|
79 |
represent byte ranges to compare within the files. Each |
|
|
80 |
range can be expressed in several ways: |
|
|
81 |
|
|
|
82 |
|
|
|
83 |
__M+N__ |
|
|
84 |
|
|
|
85 |
|
|
|
86 |
Skip ''M'' bytes at the beginning of the input, then |
|
|
87 |
compare a maximum of ''N'' bytes. |
|
|
88 |
|
|
|
89 |
|
|
|
90 |
__M-N, M,N__ |
|
|
91 |
|
|
|
92 |
|
|
|
93 |
Skip ''M'' bytes at the beginning of the input, and read |
|
|
94 |
between bytes ''M'' and ''N'', which are both |
|
|
95 |
zero-based. |
|
|
96 |
|
|
|
97 |
|
|
|
98 |
In either case, both ''M'' and ''N'' are optional and |
|
|
99 |
default to beginning and end of file, respectively. In |
|
|
100 |
addition, they can be expressed in decimal, octal |
|
|
101 |
(''0NNN'') or hexadecimal (''0xNNN'') |
|
|
102 |
form. |
|
|
103 |
!!NOTES |
|
|
104 |
|
|
|
105 |
|
|
|
106 |
The zero-based range numbers may seem inconsistent with |
|
|
107 |
__cmp__ output, which is one-based; this is for |
|
|
108 |
compatibility with some versions of __cmp__ which allow |
|
|
109 |
__N'' bytes |
|
|
110 |
''N'' is |
|
|
111 |
zero-based. |
|
|
112 |
!!DIAGNOSTICS |
|
|
113 |
|
|
|
114 |
|
|
|
115 |
The __cmp__ utility exits with one of the following |
|
|
116 |
values: |
|
|
117 |
|
|
|
118 |
|
|
|
119 |
__0__ |
|
|
120 |
|
|
|
121 |
|
|
|
122 |
The files or byte ranges are identical. |
|
|
123 |
|
|
|
124 |
|
|
|
125 |
__1__ |
|
|
126 |
|
|
|
127 |
|
|
|
128 |
The files or byte ranges are different; this includes the |
|
|
129 |
case where one file or range is identical to the first part |
|
|
130 |
of the other. In the latter case, if __-s__ has not been |
|
|
131 |
specified, __cmp__ writes to standard output that EOF was |
|
|
132 |
reached in the shorter file. |
|
|
133 |
|
|
|
134 |
|
|
|
135 |
____ |
|
|
136 |
|
|
|
137 |
|
|
|
138 |
An error occurred. |
|
|
139 |
!!SEE ALSO |
|
|
140 |
|
|
|
141 |
|
2 |
perry |
142 |
diff(1), diff3(1) |
1 |
perry |
143 |
!!STANDARDS |
|
|
144 |
|
|
|
145 |
|
|
|
146 |
The __cmp__ utility is expected to be ''POSIX |
|
|
147 |
1003.2''-compliant. |
|
|
148 |
---- |