cmp Exit Status in Shell: Equal Files, Different Files, and Errors
Handle cmp's three outcomes correctly when comparing artifacts, preserving difference-versus-error semantics in conditionals and pipelines.
tag
5 posts
Handle cmp's three outcomes correctly when comparing artifacts, preserving difference-versus-error semantics in conditionals and pipelines.
Handle grep's match, no-match, and error statuses explicitly while preserving filenames, pipeline failures, and predictable regular-expression behavior.
Reason about Bash AND-OR lists correctly, avoid rollback bugs from mixed operators, and preserve the intended status flow.
Understand Bash arithmetic-command status, increment edge cases, integer evaluation, and interactions with errexit and conditional lists.
Read Fish pipeline results correctly with status and pipestatus, snapshot stage codes before they change, and distinguish real failures from expected SIGPIPE.