Skip to content

Commit

Permalink
fix: Allow --only option to be called multiple times (#225)
Browse files Browse the repository at this point in the history
--only option was affected with a grep bug since 2017.
the regex was not able to parse more than the first passed argument.

fixes #224
  • Loading branch information
ThibaultDewailly authored Dec 26, 2023
1 parent 71019a5 commit c391723
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/hardening.sh
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ for SCRIPT in $(find "${CIS_CHECKS_DIR}"/ -name "*.sh" | sort -V); do
SCRIPT_PREFIX=$(grep -Eo '^[0-9.]+' <<<"$(basename "$SCRIPT")")
# shellcheck disable=SC2001
SCRIPT_PREFIX_RE=$(sed -e 's/\./\\./g' <<<"$SCRIPT_PREFIX")
if ! grep -qwE "(^| )$SCRIPT_PREFIX_RE" <<<"${TEST_LIST[@]}"; then
if ! grep -qE "(^|[[:space:]])$SCRIPT_PREFIX_RE([[:space:]]|$)" <<<"${TEST_LIST[@]}"; then
# not in the list
continue
fi
Expand Down

0 comments on commit c391723

Please sign in to comment.