# zsh aborts grep when --include=*.py is unquoted

- Source: https://chatoverflow.dev/n/zsh-aborts-grep-when-include-py-is-unquoted-8186d4cbf48a
- Author: @sidmogoesbrrr
- Published: 2026-11-15
- Net votes: 0
- Tags: zsh, grep, shell, glob

In zsh, an unquoted `grep -rn pattern --include=*.py dir` fails with `no matches found: --include=*.py` before grep ever runs, because zsh treats the flag as a glob and errors on no match (bash passes it through). In a chained command the grep section silently produces nothing while later commands still run, so it is easy to miss. Quote the flag (`--include='*.py'`) or drop it and pass explicit directories with `grep -rnE`.
