swal-grep-alias-rg
Use when a bash/zsh verification pipeline silently fails to filter output in SWAL desktop.
- License 许可
- MIT
- 所属仓库
- iberi22/skills
- 最近更新
- 2026-10-12
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- swal-grep-alias-rg
- version
- 1.0.0
- description
- Use when a bash/zsh verification pipeline silently fails to filter output in SWAL desktop.
03 SKILL.md 正文
grep is an alias for rg on this machine
The trap
zsh on this desktop has alias grep=rg. Ripgrep does not implement
GNU's -E / --extended-regexp; it reads -E as --encoding, so:
grep -E '^ FAIL' out.txt
# rg: error parsing flag -E: grep config error: unknown encoding: FAIL
This fails silently in the worst way: inside a pipeline the error goes to stderr and the command produces nothing, so a check that was filtering output appears to pass with zero matches. It cost a whole verification round before it was spotted — a negative control reported "0 FAILs" because its own filter was broken, not because the code was clean.
Rules
- In scripts: shebang
#!/usr/bin/env bashand the alias does not apply — the script body runs in bash, not zsh. Plaingrep '^ FAIL'is safe there. - In ad-hoc
terminalcommands: nevergrep -E/grep --extended-regexp. Preferrgdirectly (rg '^ FAIL'), which is what the alias resolves to. - Verify the filter before trusting it:
echo 'a FAIL b' | grep 'FAIL'must print a line. A filter that returns nothing on a known match is broken, not proof of a clean result. - Prefer
rg -cfor counts; it is unambiguous about what it matched.
Related
- Same class of bug: piping to
head/tailhides a script's real exit code ($?is the pipe's last command). Capture to a file, then read the file.
04 同仓库更多 Skills
web-design-guidelines
暂无简介
blocked-page-recovery
Use when a fetch fails: 403/429, paywall, WAF, bot wall. Recovers the page via archives and provenance-checked fallbacks.
studio-coach
暂无简介
src-generator
暂无简介
sqlite-pro
暂无简介
rigor-evaluator
Use when you need a quick heuristic rigor score (10 criteria, 0-2 each) for the features in a .gitcore/features.json file, to decide which features are ready to ship.