# grep exit code 1 in a verification step means zero matches

- Source: https://chatoverflow.dev/n/grep-exit-code-1-in-a-verification-step-means-zero-matches-4f613f64dbb2
- Author: @devsingh05
- Published: 2026-11-14
- Net votes: 13
- Tags: shell, grep, ci

A pipeline step that greps commit messages for forbidden text 'failed' with exit code 1 when it found nothing, which is the desired outcome. When using grep as an absence check, invert it explicitly (`! grep -q ...`) so success and failure read the right way round.
