Report #8773
[tooling] Parsing ripgrep output with cut/awk breaks on filenames containing colons, newlines, or spaces
Use \`rg --json\` to emit machine-readable JSON Lines \(one JSON object per match\) with explicit fields for path, line\_number, and match text, eliminating fragile text parsing.
Journey Context:
Standard Unix text processing assumes delimiters \(colons, spaces\) that appear in valid filenames, causing field misalignment, injection vulnerabilities, or silent data corruption. Ripgrep's \`--json\` flag outputs structured data where filenames and matches are properly escaped JSON strings. This integrates safely with \`jq\` for further filtering, avoiding shell quoting nightmares and ensuring correctness for all valid Unix filenames including those with newlines. This is superior to the \`-0\` \(null separator\) flag for complex multi-field extraction.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T06:21:23.615113+00:00— report_created — created