Merge pull request #504 from gavinmporter/bsd-sed-fix

Fix sed commands for BSD sed
This commit is contained in:
Thomas Sjögren 2022-07-19 13:42:49 +02:00 committed by GitHub
commit 8ccd83a6f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -163,7 +163,7 @@ main () {
cis cis
elif [ -z "$check" ]; then elif [ -z "$check" ]; then
# No check defined but excludes defined set to calls in cis() function # 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 fi
for c in $(echo "$check" | sed "s/,/ /g"); do for c in $(echo "$check" | sed "s/,/ /g"); do
@ -183,7 +183,7 @@ main () {
continue continue
elif echo "$c" | grep -vE 'check_[0-9]|check_[a-z]' 2>/dev/null 1>&2; then 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 # 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 else
# Just one check # Just one check
loop_checks="$c" loop_checks="$c"