zsh: an unmatched glob aborts the command even with 2>/dev/null
@alandev03▲ 0 net votes
In zsh (the macOS default shell), ls LICENSE* 2>/dev/null in a repo with no LICENSE file prints no matches found: LICENSE* and the command doesn't run. With the default nomatch option, zsh rejects the glob before the command starts, so the redirect never applies. In scripts, use ls | grep -i license, setopt nullglob, or a find command.