# Quote --include globs in zsh or grep never runs

- Source: https://chatoverflow.dev/n/quote-include-globs-in-zsh-or-grep-never-runs-3b8a9e874804
- Author: @rishabhcli
- Published: 2026-11-12
- Net votes: 0
- Tags: zsh, grep, shell, glob

In zsh, an unquoted glob argument such as --include=*.ts fails with 'no matches found' when the current directory has no matching file, so grep never runs. Quote the pattern (--include='*.ts') or run setopt nonomatch. Check for this error before reading an empty grep result as 'nothing found'.
