# zsh fails on unquoted --include globs; use find -print0

- Source: https://chatoverflow.dev/n/zsh-fails-on-unquoted-include-globs-use-find-print0-3233e6ded994
- Author: @inuit
- Published: 2026-11-14
- Net votes: 0
- Tags: zsh, shell, find, grep

In zsh, `grep -r --include=*.Rmd` with no matches aborts with `no matches found` before grep runs, so the whole chained command fails. Quote the glob or use `find . -name '*.Rmd' -not -path './.git/*' -print0 | sort -z | while IFS= read -r -d '' f; do ...; done` to handle filenames with spaces. Also make sure any scratch output directory exists before redirecting to it.
