From a51268e3b947a58e0808b0db249c1d08ac6f44a9 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sat, 29 Jan 2011 17:26:22 +0100 Subject: when using nullglob for specific sections, return to default bash behavior again afterwards --- src/aif-report-issues.sh | 1 + src/core/libs/lib-blockdevices-filesystems.sh | 4 +++- src/core/libs/lib-flowcontrol.sh | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/aif-report-issues.sh b/src/aif-report-issues.sh index 5ed18f4..06be8c8 100755 --- a/src/aif-report-issues.sh +++ b/src/aif-report-issues.sh @@ -31,6 +31,7 @@ then bin=${bin/ /} # for some reason there is a space in the beginning report="$report\n$i $bin" done + shopt -u nullglob fi echo "It can also be useful to upload a list of currently mounted filesystems:" diff --git a/src/core/libs/lib-blockdevices-filesystems.sh b/src/core/libs/lib-blockdevices-filesystems.sh index d00ef81..bcde961 100644 --- a/src/core/libs/lib-blockdevices-filesystems.sh +++ b/src/core/libs/lib-blockdevices-filesystems.sh @@ -257,10 +257,11 @@ findblockdevices() { disk=$(basename $devpath) echo -ne "/dev/$disk $1" cd /sys/block/$disk + shopt -s nullglob for part in $disk* do # check if not already assembled to a raid device. TODO: what is the significance of the 5? ASKDEV - if ! grep -q $part /proc/mdstat 2>/dev/null && ! fstype 2>/dev/null /dev/null | grep -q '5' + if [ -n "$part" ] && ! grep -q $part /proc/mdstat 2>/dev/null && ! fstype 2>/dev/null /dev/null | grep -q '5' then if [ -d $part ] then @@ -268,6 +269,7 @@ findblockdevices() { fi fi done + shopt -u nullglob done # mapped devices for devpath in $(ls /dev/mapper 2>/dev/null | grep -v control) diff --git a/src/core/libs/lib-flowcontrol.sh b/src/core/libs/lib-flowcontrol.sh index b9830b0..4f3bbfa 100755 --- a/src/core/libs/lib-flowcontrol.sh +++ b/src/core/libs/lib-flowcontrol.sh @@ -45,6 +45,7 @@ load_module () module=$(basename "$module") load_${submodule} "$1" "$module" done + shopt -u nullglob fi done -- cgit v1.2.3-54-g00ecf