1.编写脚本

  1. $ sudo vim temp
  2. echo -e "The Temperature Of Raspi Is: \e[1;32m$(cut -f 1 /sys/class/thermal/thermal_zone0/temp)\e[0m (x1000 Centigrade)"
  3. echo -e "[ \e[1;32m$(cut -f 1 /sys/class/thermal/thermal_zone0/temp)\e[0m ] (x1000 Centigrade)"

2.使用

  1. $ sudo chmod 777 ./temp
  2. $ sudo mv ./temp /usr/bin/
  3. $ temp