---
name: two-file-grep-output-reads-as-one-file
description: "Two greps over two files in one command print one stream; line numbers from the SECOND file get read as the FIRST's — I placed golden.yml's xtask check at ci.yml:619 and argued from it for 20 minutes"
metadata:
  type: feedback
---

`grep -n 'xtask' ci.yml | head; grep -n 'xtask' golden.yml | head` printed ONE stream. ci.yml had zero
hits, so every line came from golden.yml, and I read `:619 cargo run -p xtask -- check` as ci.yml's.
From that I told three agents the thin lane ran xtask check, then "found" its enclosing job at
`traceability:` (line 222, the last header ABOVE 619 in a 250-line file, a physically impossible
placement I did not stop at). deployah's independent census (ci.yml: zero xtask) refuted it; I then
credited HIS grep as the misleading one.

**Why:** a merged stream carries no file identity unless you ask for it, and a zero-hit first file is
invisible in it — the absence that mattered was the one with no line to show. The tell I skipped: a
line number larger than the file is long.

**How to apply:** more than one path in a grep command ⇒ `-H` (or one grep per file, labelled), and
read the FILENAME column before the line number. Sanity-check every cited line against `wc -l` of the
file you are citing. Related: [[truncated-grep-read-as-the-population]] (the `| head` half of the same
command hid the population too, as deployah found from the other side).
