#611
Add cmp
What are you trying to do?
Check in a script whether two files are identical, e.g. cmp -s a b && echo same. In just-bash 3.6.0 that's bash: cmp: command not found (exit 127).
Proposed behavior
The basic GNU cmp:
cmp a bprintsa b differ: byte 1, line 1at the first difference.-sprints nothing.-llists the differing bytes.- Exit status is 0 when the files are identical, 1 when they differ, and 2 on trouble.
Alternatives
diff -q a b >/dev/null works for text files, but people and agents reach for cmp first and get 127.
Additional context
Our LLM agent tried cmp in an eval run and had to fall back to diff. Node 26 on macOS.
Activity
0No activity yet.