diff --git a/completions/_mock b/completions/_mock index 480c4007a9e..c956cb726b0 100644 --- a/completions/_mock +++ b/completions/_mock @@ -45,7 +45,7 @@ _comp_cmd_mock() # This would actually depend on what the target root # can be used to build for... _comp_compgen_split -- "$(command rpm --showrc | command sed -ne \ - 's/^\s*compatible\s\s*archs\s*:\s*\(.*\)/\1/i p')" + 's/^[[:space:]]*compatible[[:space:]]\{1,\}archs[[:space:]]*:[[:space:]]*\(.*\)/\1/i p')" return ;; --enable-plugin | --disable-plugin) diff --git a/completions/_yum b/completions/_yum index 9933fd80ed2..8879c81778a 100644 --- a/completions/_yum +++ b/completions/_yum @@ -25,7 +25,7 @@ _comp_cmd_yum__compgen_repolist() # Drop first ("repo id repo name") and last ("repolist: ...") rows _comp_compgen_split -- "$( yum --noplugins -C repolist "$1" 2>/dev/null | - command sed -ne '/^repo\s\s*id/d' -e '/^repolist:/d' \ + command sed -ne '/^repo[[:space:]]\{1,\}id/d' -e '/^repolist:/d' \ -e 's/[[:space:]].*//p' )" } diff --git a/completions/chronyc b/completions/chronyc index 7c1a74e1b41..15a784b2279 100644 --- a/completions/chronyc +++ b/completions/chronyc @@ -4,7 +4,7 @@ _comp_cmd_chronyc__command_args() { local -a args _comp_split args "$("$1" help 2>/dev/null | - _comp_awk '/^'"$prev"'\s[^ []/ { gsub("\\|", " ", $2); print $2 }')" + _comp_awk '/^'"$prev"'[ \t][^ []/ { gsub("\\|", " ", $2); print $2 }')" case $args in \
) _comp_compgen_known_hosts -- "$cur" ;; \<*) ;; diff --git a/completions/puppet b/completions/puppet index a6f5d5985e7..3a8f5859008 100644 --- a/completions/puppet +++ b/completions/puppet @@ -24,7 +24,7 @@ _comp_cmd_puppet__certs() if [[ $1 == --all ]]; then cert_list=$( $puppetca --list --all | - command sed -e 's/^[+-]\{0,1\}\s*\(\S\{1,\}\)\s\{1,\}.*$/\1/' + command sed -e 's/^[+-]\{0,1\}[[:space:]]*\([^[:space:]]\{1,\}\)[[:space:]]\{1,\}.*$/\1/' ) else cert_list=$("$puppetca" --list) @@ -35,7 +35,7 @@ _comp_cmd_puppet__certs() _comp_cmd_puppet__types() { puppet_types=$( - puppet describe --list | command sed -e 's/^\(\S\{1,\}\).*$/\1/' + puppet describe --list | command sed -e 's/^\([^[:space:]]\{1,\}\).*$/\1/' ) _comp_compgen -a -- -W "$puppet_types" } @@ -47,7 +47,7 @@ _comp_cmd_puppet__references() puppetdoc=puppetdoc puppet_doc_list=$( - $puppetdoc --list | command sed -e 's/^\(\S\{1,\}\).*$/\1/' + $puppetdoc --list | command sed -e 's/^\([^[:space:]]\{1,\}\).*$/\1/' ) _comp_compgen -a -- -W "$puppet_doc_list" } diff --git a/completions/rpm b/completions/rpm index c9e95bbae72..fdb65ece2a1 100644 --- a/completions/rpm +++ b/completions/rpm @@ -45,7 +45,7 @@ _comp_cmd_rpm__macros() _comp_cmd_rpm__buildarchs() { _comp_compgen_split -- "$("${1:-rpm}" --showrc | command sed -ne \ - 's/^\s*compatible\s\s*build\s\s*archs\s*:\s*\(.*\)/\1/ p')" + 's/^[[:space:]]*compatible[[:space:]]\{1,\}build[[:space:]]\{1,\}archs[[:space:]]*:[[:space:]]*\(.*\)/\1/ p')" } # shellcheck disable=SC2120