shellcheck
shellcheck copied to clipboard
SC2227 should only apply when there is an additional command
https://www.shellcheck.net/wiki/SC2227 states:
Redirection applies to the find command itself. Rewrite to work per action (or move to end).
Problematic code: find . -name '*.ppm' -exec pnmtopng {} > {}.png ;
… but this warning triggers even with a command such as:
find "${log}" 2>/dev/null \
-mindepth 4 \
-maxdepth 5 \
-name 'build.log' -or -name 'config.log' \
-type f \
-print
… where, since there is no additional command being executed, there doesn't appear to be any such ambiguity?