From 1b48d1c5b79c9a7ea79a7cebedc4c4c4f97a8e08 Mon Sep 17 00:00:00 2001 From: dak180 Date: Mon, 28 May 2018 20:00:18 -0400 Subject: [PATCH] Use an array. --- disk-burnin.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/disk-burnin.sh b/disk-burnin.sh index 2ccff0a..d27417b 100755 --- a/disk-burnin.sh +++ b/disk-burnin.sh @@ -194,7 +194,16 @@ elif [ ! -e "/dev/${driveID}" ]; then fi #check if needed software is installed -for command in grep pcregrep awk sed tr sleep badblocks; do +commands=( +grep +pcregrep +awk +sed +tr +sleep +badblocks +) +for command in "${commands[@]}"; do if ! type "${command}" &> /dev/null; then echo "${command} is missing, please install" exit 100