From b29f676bbbc2e1f8fa955f5bfc2ab351c9ac0938 Mon Sep 17 00:00:00 2001 From: Gavin Porter Date: Tue, 19 Jul 2022 11:11:19 +1200 Subject: [PATCH] Fix sed commands for BSD sed --- docker-bench-security.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-bench-security.sh b/docker-bench-security.sh index d55dbd8f..a698a844 100755 --- a/docker-bench-security.sh +++ b/docker-bench-security.sh @@ -163,7 +163,7 @@ main () { cis elif [ -z "$check" ]; then # No check defined but excludes defined set to calls in cis() function - check=$(sed -ne "/cis() {/,/}/{/{/d; /}/d; p}" functions/functions_lib.sh) + check=$(sed -ne "/cis() {/,/}/{/{/d; /}/d; p;}" functions/functions_lib.sh) fi for c in $(echo "$check" | sed "s/,/ /g"); do @@ -183,7 +183,7 @@ main () { continue elif echo "$c" | grep -vE 'check_[0-9]|check_[a-z]' 2>/dev/null 1>&2; then # Function not a check, fill loop_checks with all check from function - loop_checks="$(sed -ne "/$c() {/,/}/{/{/d; /}/d; p}" functions/functions_lib.sh)" + loop_checks="$(sed -ne "/$c() {/,/}/{/{/d; /}/d; p;}" functions/functions_lib.sh)" else # Just one check loop_checks="$c"