From c6f0bdfecc7b1bbadc644eb8f625473c34fe7cae Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Thu, 5 Apr 2018 20:56:53 +0100 Subject: 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 --- bash-completion/lsblk | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'bash-completion/lsblk') 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 -- cgit v1.2.3-55-g7522