summaryrefslogtreecommitdiff
path: root/sys/man/1/cmp
diff options
context:
space:
mode:
authorTaru Karttunen <taruti@taruti.net>2011-03-30 16:49:47 +0300
committerTaru Karttunen <taruti@taruti.net>2011-03-30 16:49:47 +0300
commitb41b9034225ab3e49980d9de55c141011b6383b0 (patch)
tree891014b4c2e803e01ac7a1fd2b60819fbc5a6e73 /sys/man/1/cmp
parentc558a99e0be506a9abdf677f0ca4490644e05fc1 (diff)
Import sources from 2011-03-30 iso image - sys/man
Diffstat (limited to 'sys/man/1/cmp')
-rwxr-xr-xsys/man/1/cmp57
1 files changed, 57 insertions, 0 deletions
diff --git a/sys/man/1/cmp b/sys/man/1/cmp
new file mode 100755
index 000000000..55888ce97
--- /dev/null
+++ b/sys/man/1/cmp
@@ -0,0 +1,57 @@
+.TH CMP 1
+.SH NAME
+cmp \- compare two files
+.SH SYNOPSIS
+.B cmp
+[
+.B -lLs
+]
+.I file1 file2
+[
+.I offset1
+[
+.I offset2
+]
+]
+.SH DESCRIPTION
+.I Cmp
+compares the two files and prints
+a message if the contents differ.
+.PP
+The options are:
+.TP
+.B -l
+Print the byte number (decimal) and the
+differing bytes (hexadecimal) for each difference.
+.TP
+.B -L
+Print the line number of the first differing byte.
+.TP
+.B -s
+Print nothing for differing files,
+but set the exit status.
+.PD
+.PP
+If offsets are given,
+comparison starts at the designated byte position
+of the corresponding file.
+Offsets that begin with
+.B 0x
+are hexadecimal;
+with
+.BR 0 ,
+octal; with anything else, decimal.
+.SH SOURCE
+.B /sys/src/cmd/cmp.c
+.SH SEE ALSO
+.IR diff (1)
+.SH DIAGNOSTICS
+If a file is inaccessible or missing, the exit status is
+.LR open .
+If the files are the same, the exit status is empty (true).
+If they are the same except that one is longer than the other, the exit status is
+.LR EOF .
+Otherwise
+.I cmp
+reports the position of the first disagreeing byte and the exit status is
+.LR differ .