Ebrius Disputatio

cpuTemp0

Initially this script was for my SOC that didn't have cool tools like vcgencmd. Usually non Raspian/Raspberry Pi Oses. It's worked for me on many types of devices and it is dependent on the program bc, which is a basic calculator program found on UNIX like systems, including Linux. The program bc is also a language too, I believe. This script gives the temperature of the cpu and, I think may give an all around sense of what the temperature in your box is.

Okay here's the script, feel free to improve upon it if needs be:

#!/bin/sh

#For the uninitiated, this is a comment

#cpuTemp0=$(cat /sys/class/thermal/thermal_zone0/temp) #cpuTemp1=$(($cpuTemp0/1000)) #cpuTemp2=$(($cpuTemp0/100)) #cpuTempM=$(($cpuTemp2 % $cpuTemp1))

#$gpuTemp0=$(/opt/vc/bin/vcgencmd measure_temp) #gpuTemp0=${gpuTemp0//\'/º} #gpuTemp0=${gpuTemp0//temp=/}

#echo CPU Temp: $cpuTemp1”.“$cpuTempM”ºC” #echo GPU Temp: $gpuTemp0

milcel=$(cat /sys/class/thermal/thermal_zone0/temp)

echo “CPU Temperature:” echo ctemp=$(echo “scale=3;$milcel/1000” | bc) echo $ctemp “°C” echo ftemp=$(echo “scale=3;(($milcel/1000)*(9/5))+32” | bc) echo $ftemp “°F” echo