From 290463858451baba0b1fea239a00ecc9e2b9cb77 Mon Sep 17 00:00:00 2001 From: Keith Nash Date: Sat, 13 May 2017 07:53:44 -0500 Subject: [PATCH] Displays drive capacity and formatting handles 10 or more CPUs --- get_hdd_temp.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/get_hdd_temp.sh b/get_hdd_temp.sh index edfd12f..78fa7f7 100644 --- a/get_hdd_temp.sh +++ b/get_hdd_temp.sh @@ -45,12 +45,12 @@ cores=$(sysctl -a | grep "hw.ncpu" | awk '{print $2}') printf "=== CPU (%s) ===\n" "${cores}" cores=$((cores - 1)) for core in $(seq 0 $cores); do - temp="$(sysctl -a | grep "cpu.${core}.temp" | cut -c24-25 | tr -d "\n")" - if [ "$temp" -lt 0 ]; then - temp="--n/a--" - else - temp="${temp}C" - fi + temp="$(sysctl -a | grep "cpu.${core}.temp" | cut -c24-25 | tr -d "\n")" + if [ "$temp" -lt 0 ]; then + temp="--n/a--" + else + temp="${temp}C" + fi printf "CPU %2.2s: %5s\n" "$core" "$temp" done echo ""