Advertisement
ulfben

check-temperature.sh

Aug 10th, 2017
348
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.31 KB | None | 0 0
  1. #!/bin/bash
  2. #check-temperature.sh - prints the value of all thermal sensors
  3. CELCIUS=$'\xc2\xb0'C
  4. for i in /sys/class/thermal/*/temp
  5. do
  6.         fileName="$i"
  7.         value=$(cat "$i")
  8.         value=$(echo "$value/1000.0" | bc) #basic calculator
  9.         printf "%s %.1f%s \\n" "$fileName" "$value" "$CELCIUS"
  10. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement