

cmp                          Command                          cmp




Compare bytes of two files

ccmmpp [-llss] _f_i_l_e_1 _f_i_l_e_2 [_s_k_i_p_1 _s_k_i_p_2]

cmp is  a command  that is  included with COHERENT.   It compares
file1 and file2 character by character for equality.  If file1 is
`-', cmp reads the standard input.

Normally, cmp notes the  first difference and prints the line and
character position, relative  to any skips.  If it encounters EOF
on one file but not on  the other, it prints the message ``EOF on
file_n''.  The  following are  the options  that can be  used with
cmp:

-ll Note  each differing byte by printing  the positions and octal
   values of the bytes of each file.

-ss Print nothing, but return the exit status.

If the  skip counts are  present, cmp reads skip1  bytes on file1
and  skip2 bytes  on file2  before it begins  to compare  the two
files.

***** See Also *****

commands, diff, sh

***** Diagnostics *****

The exit status is  zero for identical files, one for non-identi-
cal files,  and two for errors, e.g., bad  command usage or inac-
cessible file.
























COHERENT Lexicon                                           Page 1


