From 91d36b62f9081f5f812aa1d939a72cbc43091dd2 Mon Sep 17 00:00:00 2001 From: wilmardo Date: Thu, 5 Dec 2019 16:20:47 +0100 Subject: [PATCH] refact: removes variable, use result directly in loop Signed-off-by: wilmardo --- docker-bench-security.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docker-bench-security.sh b/docker-bench-security.sh index ac50a89..03dd144 100755 --- a/docker-bench-security.sh +++ b/docker-bench-security.sh @@ -146,8 +146,7 @@ main () { if command -v "$i" 2>/dev/null 1>&2; then if [ "$checkexclude" ]; then checkexcluded="$(echo ",$checkexclude" | sed -e 's/^/\^/g' -e 's/,/\$|/g' -e 's/$/\$/g')" - included_checks=$(sed -ne "/$i() {/,/}/{/{/d; /}/d; p}" functions_lib.sh | grep -vE "$checkexcluded") - for check in $included_checks; do + for check in $(sed -ne "/$i() {/,/}/{/{/d; /}/d; p}" functions_lib.sh | grep -vE "$checkexcluded"); do "$check" done else