WILLYDOS_SOL

snurfete

Nov 30th, 2023
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh
  2. ncupus=`sysctl -n hw.ncpu`
  3. while :; do
  4.     echo -e "\ec\e[1mCPU Temperature\e[0m \e[3m[press ^C to exit]\e[0m"
  5.     for cpus in `seq 0 $((${ncpus}-1))`; do
  6.         printf "%s %3s %s%6s \t%s%5s\n"\
  7.         "cpu" $cpus\
  8.         "temp:" `sysctl -n dev.cpu.$cpus.temperature`\
  9.         "freq:" `sysctl -n dev.cpu.$cpus.freq`
  10.     done
  11.     sleep 0.2
  12.     echo -e '\r\e['$((${ncpus}+1))'A'
  13. done
Add Comment
Please, Sign In to add comment