summaryrefslogtreecommitdiffstats
path: root/bash-completion
diff options
context:
space:
mode:
authorSami Kerola2018-04-05 21:56:53 +0200
committerKarel Zak2018-04-06 13:03:38 +0200
commitc6f0bdfecc7b1bbadc644eb8f625473c34fe7cae (patch)
tree7dc67f9ac07525943544e9a3034ea362fb992386 /bash-completion
parentfstrim: Return EXIT_FAILURE when FTRIM ioctl fails (diff)
downloadkernel-qcow2-util-linux-c6f0bdfecc7b1bbadc644eb8f625473c34fe7cae.tar.gz
kernel-qcow2-util-linux-c6f0bdfecc7b1bbadc644eb8f625473c34fe7cae.tar.xz
kernel-qcow2-util-linux-c6f0bdfecc7b1bbadc644eb8f625473c34fe7cae.zip
bash-completion: fix few bash set -u issues
This is the same fix as in reference commit, and the same reason. Just correct few files missed earlier. Reference: abbcec4fc9c8d7fb835b4eafd1bc9d82acbf0056 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'bash-completion')
-rw-r--r--bash-completion/chcpu4
-rw-r--r--bash-completion/lsblk10
-rw-r--r--bash-completion/lscpu2
-rwxr-xr-xbash-completion/lslogins2
-rw-r--r--bash-completion/lsns2
-rw-r--r--bash-completion/mount2
-rw-r--r--bash-completion/setpriv2
-rw-r--r--bash-completion/taskset2
8 files changed, 13 insertions, 13 deletions
diff --git a/bash-completion/chcpu b/bash-completion/chcpu
index 33991f4a8..0d96c2532 100644
--- a/bash-completion/chcpu
+++ b/bash-completion/chcpu
@@ -12,7 +12,7 @@ _chcpu_module()
CPULIST_ALL=$(sed 's/^/{/; s/-/../g; s/,/} {/g; s/$/}/' /sys/devices/system/cpu/offline)
for WORD in $(eval echo $CPULIST_ALL); do
if ! [[ $prefix == *"$WORD"* ]]; then
- CPULIST="$WORD $CPULIST"
+ CPULIST="$WORD ${CPULIST:-""}"
fi
done
compopt -o nospace
@@ -26,7 +26,7 @@ _chcpu_module()
CPULIST_ALL=$(sed 's/^/{/; s/-/../g; s/,/} {/g; s/$/}/' /sys/devices/system/cpu/online)
for WORD in $(eval echo $CPULIST_ALL); do
if ! [[ $prefix == *"$WORD"* ]]; then
- CPULIST="$WORD $CPULIST"
+ CPULIST="$WORD ${CPULIST:-""}"
fi
done
compopt -o nospace
diff --git a/bash-completion/lsblk b/bash-completion/lsblk
index 4fef8fc84..bd86f9f79 100644
--- a/bash-completion/lsblk
+++ b/bash-completion/lsblk
@@ -20,15 +20,15 @@ _lsblk_module()
prefix="${cur%$realcur}"
for I in /sys/dev/block/*; do
J=${I##*/}
- MAJOR_ALL="$MAJOR_ALL ${J%%:*}"
+ MAJOR_ALL="${MAJOR_ALL:-""} ${J%%:*}"
done
- for WORD in $MAJOR_ALL; do
+ for WORD in ${MAJOR_ALL:-""}; do
if ! [[ $prefix == *"$WORD"* ]]; then
- MAJOR="$WORD $MAJOR"
+ MAJOR="$WORD ${MAJOR:-""}"
fi
done
compopt -o nospace
- COMPREPLY=( $(compgen -P "$prefix" -W "$MAJOR" -S ',' -- $realcur) )
+ COMPREPLY=( $(compgen -P "$prefix" -W "${MAJOR:-""}" -S ',' -- $realcur) )
return 0
;;
'-o'|'--output')
@@ -37,7 +37,7 @@ _lsblk_module()
prefix="${cur%$realcur}"
for WORD in $LSBLK_COLS_ALL; do
if ! [[ $prefix == *"$WORD"* ]]; then
- LSBLK_COLS="$WORD $LSBLK_COLS"
+ LSBLK_COLS="$WORD ${LSBLK_COLS:-""}"
fi
done
compopt -o nospace
diff --git a/bash-completion/lscpu b/bash-completion/lscpu
index d16af350f..69337acef 100644
--- a/bash-completion/lscpu
+++ b/bash-completion/lscpu
@@ -15,7 +15,7 @@ _lscpu_module()
CONFIGURED ONLINE MAXMHZ MINMHZ"
for WORD in $OPTS_ALL; do
if ! [[ $prefix == *"$WORD"* ]]; then
- OPTS="$WORD $OPTS"
+ OPTS="$WORD ${OPTS:-""}"
fi
done
compopt -o nospace
diff --git a/bash-completion/lslogins b/bash-completion/lslogins
index 967b644ca..795b5d848 100755
--- a/bash-completion/lslogins
+++ b/bash-completion/lslogins
@@ -35,7 +35,7 @@ _lslogins_module()
prefix="${cur%$realcur}"
for WORD in $LSLOGINS_COLS_ALL; do
if ! [[ $prefix == *"$WORD"* ]]; then
- LSLOGINS_COLS="$WORD $LSLOGINS_COLS"
+ LSLOGINS_COLS="$WORD ${LSLOGINS_COLS:-""}"
fi
done
compopt -o nospace
diff --git a/bash-completion/lsns b/bash-completion/lsns
index 8cf0a31f9..035f43b2a 100644
--- a/bash-completion/lsns
+++ b/bash-completion/lsns
@@ -14,7 +14,7 @@ _lsns_module()
prefix="${cur%$realcur}"
for WORD in $LSNS_COLS_ALL; do
if ! [[ $prefix == *"$WORD"* ]]; then
- LSNS_COLS="$WORD $LSNS_COLS"
+ LSNS_COLS="$WORD ${LSNS_COLS:-""}"
fi
done
compopt -o nospace
diff --git a/bash-completion/mount b/bash-completion/mount
index 9a3391339..c7e4bead6 100644
--- a/bash-completion/mount
+++ b/bash-completion/mount
@@ -15,7 +15,7 @@ _mount_module()
prefix="${cur%$realcur}"
for WORD in $TYPES; do
if ! [[ $prefix == *"$WORD"* ]]; then
- TYPE_COLS="$WORD $TYPE_COLS"
+ TYPE_COLS="$WORD ${TYPE_COLS:-""}"
fi
done
compopt -o nospace
diff --git a/bash-completion/setpriv b/bash-completion/setpriv
index 8ab9e0722..bf4737a3a 100644
--- a/bash-completion/setpriv
+++ b/bash-completion/setpriv
@@ -38,7 +38,7 @@ _setpriv_module()
GIDS_ALL=$(getent group | awk -F: '{print $3}')
for WORD in $GIDS_ALL; do
if ! [[ $prefix == *"$WORD"* ]]; then
- GIDS="$WORD $GIDS"
+ GIDS="$WORD ${GIDS:-""}"
fi
done
compopt -o nospace
diff --git a/bash-completion/taskset b/bash-completion/taskset
index 453b17b4a..7c9a7bd54 100644
--- a/bash-completion/taskset
+++ b/bash-completion/taskset
@@ -12,7 +12,7 @@ _taskset_module()
CPULIST_ALL=$(sed 's/^/{/; s/-/../g; s/,/} {/g; s/$/}/' /sys/devices/system/cpu/online)
for WORD in $(eval echo $CPULIST_ALL); do
if ! [[ $prefix == *"$WORD"* ]]; then
- CPULIST="$WORD $CPULIST"
+ CPULIST="$WORD ${CPULIST:-""}"
fi
done
compopt -o nospace