Skip to content

Commit

Permalink
Only enable nullglob as needed
Browse files Browse the repository at this point in the history
  • Loading branch information
slowpeek committed Mar 30, 2024
1 parent d0cb61d commit 74b12d7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions hddtemp-lt
Original file line number Diff line number Diff line change
Expand Up @@ -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]##*/}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 74b12d7

Please sign in to comment.