~sircmpwn/ctools

ref: 0e9f63c42367ef836a3dbe9369cb987558b0d9e3 ctools/doc/cmp.1.scd -rw-r--r-- 1.4 KiB
0e9f63c4 — Christopher Vittal Add dirname 1 year, 10 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
cmp(1) "ctools"

# NAME

cmp - compare two files

# SYNOPSIS

*cmp* [-l|-s] _file1_ _file2_

# DESCRIPTION

*cmp* will compare two text files and find the location of the first character
which differs between them. If a difference is found, it will print the
character index and line number at which the difference was found.

# OPTIONS

*-l*
	When a difference is found, instead of printing a human-friendly
	message, print the index (in decimal) and the offending characters
	found there (in octal), separated with spaces.

*-s*
	Do not output anything if the files differ, instead the exit status
	must be consulted to determine the result.

The *-l* and *-s* options are mutually exclusive.

# EXIT STATUS

|] 0
:[ The files are identical
|  1
:  The files are different
|  >1
:  An error occured

# UNSPECIFIED BEHAVIOR

The POSIX standard does not unambiguously specify the behavior of this command
under certain conditions. Under such conditions, the ctools implementation of
*cmp* behaves as follows:

- If an error occurs and *-s* was specified, *cmp* may randomly choose not to
  print the appropriate diagnostic messages to stderr.

# DISCLAIMER

This command is part of ctools and is compatible with POSIX-1.2017, and may
optionally support XSI extensions. This man page is not intended to be a
complete reference, and where it disagrees with the specification, the
specification takes precedence.