]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - bash-completion/chcpu
login: add support for directories in MOTD_FILE=
[thirdparty/util-linux.git] / bash-completion / chcpu
index 33991f4a82b19699f877b0e98151acfccf288f69..0d96c25321e6cce7f15696460226c46775d79f7d 100644 (file)
@@ -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