Updated SC2227 (markdown)

Vidar Holen
2021-08-31 11:53:00 -04:00
parent 72e6e3a6c4
commit 01bf3d8bc4

@@ -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 '...' _ {} \;` 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 \; # Ambiguous syntax. Is it per -exec or not?
find . -exec foo {} \; > /dev/null # Identical command with clear intent. find . -exec foo {} \; > /dev/null # Identical command with clear intent.
### Exceptions: There is no difference in behavior between the two.
None
### Related resources: ### Related resources: