From 01bf3d8bc45f8f6997b810a5047dd1487090e724 Mon Sep 17 00:00:00 2001 From: Vidar Holen Date: Tue, 31 Aug 2021 11:53:00 -0400 Subject: [PATCH] Updated SC2227 (markdown) --- SC2227.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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: