Skip to content

Commit

Permalink
Fix sed commands for BSD sed
Browse files Browse the repository at this point in the history
  • Loading branch information
Gavin Porter committed Jul 18, 2022
1 parent 44fdceb commit b29f676
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docker-bench-security.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down

0 comments on commit b29f676

Please sign in to comment.