Skip to content

Instantly share code, notes, and snippets.

@imaami
Created February 2, 2020 13:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imaami/2a6c3722de08d1364b37c12e0947e5a6 to your computer and use it in GitHub Desktop.
Save imaami/2a6c3722de08d1364b37c12e0947e5a6 to your computer and use it in GitHub Desktop.
Quick & dirty script that prints thermals from /sys
#!/bin/bash
for f in $(find /sys/ | grep -E '/temp[0-9]+_input'); do
t="${f%_input}_type"
l="${f%_input}_label"
if [[ -e $t ]]; then
t=$(<$t)
else
t=' '
fi
z="${f##*/}"
z="${z%_*}"
echo "$z"$'\t'"[$t]"$'\t'$(<$f)$'\t'$(<$l)
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment