From 74b12d71636d335dbf1cc2b21b62bb65236c04bd Mon Sep 17 00:00:00 2001 From: slowpeek Date: Sat, 30 Mar 2024 12:20:15 +0200 Subject: [PATCH] Only enable nullglob as needed --- hddtemp-lt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hddtemp-lt b/hddtemp-lt index 1ae3203..19dcc8e 100755 --- a/hddtemp-lt +++ b/hddtemp-lt @@ -5,7 +5,6 @@ # About: smartctl-based alternative to hddtemp set -eu -shopt -s nullglob SCRIPT_VERSION=0.2.3+git SCRIPT_SELF=${BASH_SOURCE[0]##*/} @@ -185,7 +184,11 @@ main() { log_warn "startctl supports NVMe devices since v6.5 (yours is v${ver})" # If no args supplied, assume all sd and nvme disks. - (( $# )) || set -- /dev/sd? /dev/sd?[a-z] /dev/nvme?n? + if (( ! $# )); then + shopt -s nullglob + set -- /dev/sd? /dev/sd?[a-z] /dev/nvme?n? + shopt -u nullglob + fi local items=() l_disk=0 l_name=1 local disk name temp lines line parser