IMP(shellcheck): disable sed replacement (SC2001)

Shellcheck recommands to replace sed by shell expansions in 'simple' cases.
However, the replacement here is likely to lead to erros, so we disable this rule.
Moreover, it does'nt really add readability.
This commit is contained in:
Thibault Ayanides
2020-12-10 08:34:57 +01:00
parent 36528b55e0
commit b9e129d8fe
18 changed files with 26 additions and 1 deletions

View File

@ -24,6 +24,7 @@ audit() {
if $SUDO_CMD [ ! -r $CONF_FILE ]; then
crit "$CONF_FILE is not readable"
else
# shellcheck disable=SC2001
does_pattern_exist_in_file $CONF_FILE "$(sed 's/ /[[:space:]]+/g' <<<"$CONF_LINE")"
if [ "$FNRET" = 0 ]; then
ok "$CONF_LINE is present in $CONF_FILE"
@ -38,6 +39,7 @@ apply() {
if $SUDO_CMD [ ! -r $CONF_FILE ]; then
crit "$CONF_FILE is not readable"
else
# shellcheck disable=SC2001
does_pattern_exist_in_file $CONF_FILE "$(sed 's/ /[[:space:]]+/g' <<<"$CONF_LINE")"
if [ "$FNRET" = 0 ]; then
ok "$CONF_LINE is present in $CONF_FILE"