#!/bin/bash
cpuTemp0=$(cat /sys/class/thermal/thermal_zone0/temp)
cpuTemp1=$(($cpuTemp0/1000))
cpuTemp2=$(($cpuTemp0/100))
cpuTempM=$(($cpuTemp2 % $cpuTemp1))
echo CPU temp"="$cpuTemp1"."$cpuTempM"'C"
Created
October 9, 2021 23:20
-
-
Save enrialonso/c918c47e412237187b4703c2662aa72f to your computer and use it in GitHub Desktop.
Get temperature of CPU Raspberry PI 4 from bash script
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment