diff --git a/shell-completion/bash/bootctl b/shell-completion/bash/bootctl index 391fa67bfc1..e61188fee94 100644 --- a/shell-completion/bash/bootctl +++ b/shell-completion/bash/bootctl @@ -69,7 +69,7 @@ _bootctl() { fi done - if [[ -z $verb ]]; then + if [[ -z ${verb-} ]]; then comps=${VERBS[*]} elif __contains_word "$verb" ${VERBS[STANDALONE]}; then comps='' diff --git a/shell-completion/bash/busctl b/shell-completion/bash/busctl index 5a4acd337ff..1cc41d46187 100644 --- a/shell-completion/bash/busctl +++ b/shell-completion/bash/busctl @@ -140,7 +140,7 @@ _busctl() { n=$(($COMP_CWORD - $i)) - if [[ -z $verb ]]; then + if [[ -z ${verb-} ]]; then comps=${VERBS[*]} elif __contains_word "$verb" ${VERBS[STANDALONE]}; then comps='' diff --git a/shell-completion/bash/coredumpctl b/shell-completion/bash/coredumpctl index 5fc11fdbd28..54b85725158 100644 --- a/shell-completion/bash/coredumpctl +++ b/shell-completion/bash/coredumpctl @@ -83,7 +83,7 @@ _coredumpctl() { fi done - if [[ -z $verb ]]; then + if [[ -z ${verb-} ]]; then comps=${VERBS[*]} elif __contains_word "$verb" ${VERBS[LIST]} ${VERBS[DUMP]}; then comps='' diff --git a/shell-completion/bash/homectl b/shell-completion/bash/homectl index fe909fbb411..f738bfb37f1 100644 --- a/shell-completion/bash/homectl +++ b/shell-completion/bash/homectl @@ -170,7 +170,7 @@ _homectl() { fi done - if [[ -z $verb ]]; then + if [[ -z ${verb-} ]]; then comps=${VERBS[*]} elif __contains_word "$verb" ${VERBS[NAME]}; then comps=$(__get_homes) diff --git a/shell-completion/bash/hostnamectl b/shell-completion/bash/hostnamectl index 0f69e23e6f8..6f1909b5994 100644 --- a/shell-completion/bash/hostnamectl +++ b/shell-completion/bash/hostnamectl @@ -77,7 +77,7 @@ _hostnamectl() { fi done - if [[ -z $verb ]]; then + if [[ -z ${verb-} ]]; then comps=${VERBS[*]} elif __contains_word "$verb" ${VERBS[CHASSIS]}; then comps='desktop laptop convertible server tablet handset watch embedded vm container' diff --git a/shell-completion/bash/localectl b/shell-completion/bash/localectl index fa0f8fdca1c..987ae34cc91 100644 --- a/shell-completion/bash/localectl +++ b/shell-completion/bash/localectl @@ -67,7 +67,7 @@ _localectl() { fi done - if [[ -z $verb ]]; then + if [[ -z ${verb-} ]]; then comps=${VERBS[*]} elif __contains_word "$verb" ${VERBS[VARIANTS]}; then comps=$(command localectl list-x11-keymap-layouts) diff --git a/shell-completion/bash/loginctl b/shell-completion/bash/loginctl index f94f191d89e..2d03fcca3ed 100644 --- a/shell-completion/bash/loginctl +++ b/shell-completion/bash/loginctl @@ -93,7 +93,7 @@ _loginctl () { fi done - if [[ -z $verb ]]; then + if [[ -z ${verb-} ]]; then comps="${VERBS[*]}" elif __contains_word "$verb" ${VERBS[SESSIONS]}; then diff --git a/shell-completion/bash/machinectl b/shell-completion/bash/machinectl index bc3a7889b38..0227167928a 100644 --- a/shell-completion/bash/machinectl +++ b/shell-completion/bash/machinectl @@ -95,7 +95,7 @@ _machinectl() { return 0 fi - if [[ -z $verb ]]; then + if [[ -z ${verb-} ]]; then comps=${VERBS[*]} elif __contains_word "$verb" ${VERBS[STANDALONE]}; then diff --git a/shell-completion/bash/networkctl b/shell-completion/bash/networkctl index 1e4d0a2aaef..40ac13abf86 100644 --- a/shell-completion/bash/networkctl +++ b/shell-completion/bash/networkctl @@ -69,7 +69,7 @@ _networkctl() { return 0 fi - if [[ -z $verb ]]; then + if [[ -z ${verb-} ]]; then comps=${VERBS[*]} elif __contains_word "$verb" ${VERBS[STANDALONE]}; then comps='' diff --git a/shell-completion/bash/portablectl b/shell-completion/bash/portablectl index e18d04c7ea8..a0ccc733adb 100644 --- a/shell-completion/bash/portablectl +++ b/shell-completion/bash/portablectl @@ -79,7 +79,7 @@ _portablectl() { n=$(($COMP_CWORD - $i)) - if [[ -z $verb ]]; then + if [[ -z ${verb-} ]]; then comps=${VERBS[*]} elif __contains_word "$verb" ${VERBS[STANDALONE]}; then comps='' diff --git a/shell-completion/bash/resolvectl b/shell-completion/bash/resolvectl index dae4330d4c5..646a197a13f 100644 --- a/shell-completion/bash/resolvectl +++ b/shell-completion/bash/resolvectl @@ -87,7 +87,7 @@ _resolvectl() { fi done - if [[ -z $verb ]]; then + if [[ -z ${verb-} ]]; then comps="${VERBS[*]}" elif __contains_word "$verb" ${VERBS[STANDALONE]} ${VERBS[DOMAIN]}; then diff --git a/shell-completion/bash/systemctl.in b/shell-completion/bash/systemctl.in index e6e6ca0d7e0..b61f88b012c 100644 --- a/shell-completion/bash/systemctl.in +++ b/shell-completion/bash/systemctl.in @@ -254,7 +254,7 @@ _systemctl () { cur_orig="$(printf '%q' $cur)" fi - if [[ -z $verb ]]; then + if [[ -z ${verb-} ]]; then comps="${VERBS[*]}" elif __contains_word "$verb" ${VERBS[ALL_UNITS]}; then diff --git a/shell-completion/bash/systemd-analyze b/shell-completion/bash/systemd-analyze index eded49b50e7..36fcf432ff9 100644 --- a/shell-completion/bash/systemd-analyze +++ b/shell-completion/bash/systemd-analyze @@ -93,12 +93,12 @@ _systemd_analyze() { return 0 fi - if [[ -z $verb && $cur = -* ]]; then + if [[ -z ${verb-} && $cur = -* ]]; then COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") ) return 0 fi - if [[ -z $verb ]]; then + if [[ -z ${verb-} ]]; then comps=${VERBS[*]} elif __contains_word "$verb" ${VERBS[STANDALONE]}; then diff --git a/shell-completion/bash/systemd-delta b/shell-completion/bash/systemd-delta index 1a24dc07109..f94c1285332 100644 --- a/shell-completion/bash/systemd-delta +++ b/shell-completion/bash/systemd-delta @@ -53,7 +53,7 @@ _systemd-delta() { return 0 fi - COMPREPLY=( $(compgen -W '$comps' -- "$cur") ) + COMPREPLY=( $(compgen -W '${comps-}' -- "$cur") ) return 0 } diff --git a/shell-completion/bash/systemd-id128 b/shell-completion/bash/systemd-id128 index 25110d13091..ad4731de18f 100644 --- a/shell-completion/bash/systemd-id128 +++ b/shell-completion/bash/systemd-id128 @@ -61,7 +61,7 @@ _systemd_id128() { fi done - if [[ -z $verb ]]; then + if [[ -z ${verb-} ]]; then comps=${VERBS[*]} elif __contains_word "$verb" ${VERBS[STANDALONE]}; then comps='' diff --git a/shell-completion/bash/timedatectl b/shell-completion/bash/timedatectl index 3e72ce6655e..29dc27b39cc 100644 --- a/shell-completion/bash/timedatectl +++ b/shell-completion/bash/timedatectl @@ -76,7 +76,7 @@ _timedatectl() { fi done - if [[ -z $verb ]]; then + if [[ -z ${verb-} ]]; then comps=${VERBS[*]} elif __contains_word "$verb" ${VERBS[BOOLEAN]}; then comps='true false' diff --git a/shell-completion/bash/udevadm b/shell-completion/bash/udevadm index d2c325b8686..81036f35883 100644 --- a/shell-completion/bash/udevadm +++ b/shell-completion/bash/udevadm @@ -73,7 +73,7 @@ _udevadm() { fi done - if [[ -z $verb ]]; then + if [[ -z ${verb-} ]]; then if [[ "$cur" = -* ]]; then COMPREPLY=( $(compgen -W '${OPTS[COMMON]} ${OPTS[DEBUG]}' -- "$cur") ) else