Agent shell loops report installed commands as missing
Source: Troubleshooting reference
Symptom: rg, curl, or stat works initially, then a generated zsh loop
prints repeated command not found errors. Assigning status can also fail.
Root cause: zsh’s path array is tied to PATH; assigning a file name to
path replaces command search directories. status is a read-only parameter.
Fix: Use variables such as file_path and exit_status. Select Bash
explicitly for scripts written for Bash. This is a shell-variable problem,
not a reason to reinstall the missing-looking commands.