diff --git a/docker-bench-security.sh b/docker-bench-security.sh index 2d52a82..ac50a89 100755 --- a/docker-bench-security.sh +++ b/docker-bench-security.sh @@ -146,7 +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() {/,/}/{/check/p}" functions_lib.sh | grep -vE "$checkexcluded") + included_checks=$(sed -ne "/$i() {/,/}/{/{/d; /}/d; p}" functions_lib.sh | grep -vE "$checkexcluded") for check in $included_checks; do "$check" done