diff --git a/SC2227.md b/SC2227.md index c311a36..58f1ce4 100644 --- a/SC2227.md +++ b/SC2227.md @@ -27,14 +27,15 @@ This redirection may have been intended to apply only to a specific action like To perform a redirection per action, rewrite it with e.g. `-exec sh -c '...' _ {} \;` -If the redirection is something like `> /dev/null` where you don't mind it applying to the whole `find` and not individual results, move the redirection to the end of command: + +### Exceptions: + +If the redirection is something like `> /dev/null` where you don't mind it applying to the whole `find` and not individual results, you can move the redirection to the end of command to make it clear to ShellCheck (and humans) that it's not meant per command: find . -exec foo {} > /dev/null \; # Ambiguous syntax. Is it per -exec or not? find . -exec foo {} \; > /dev/null # Identical command with clear intent. -### Exceptions: - -None +There is no difference in behavior between the two. ### Related resources: