#!/bin/bash
################################################
#Purpose: Show Date & Time & The Temp Of The CPU
#Author: Fuzz The Pi Guy https://www.youtube.com/fuzzthepiguy
printf "%20s%17s\n" "DATE & TIME" "TEMP (F)"
printf "%15s\n" "*************************************"
while true
do
tempC=$(vcgencmd measure_temp | egrep -o '[0-9]*\.[0-9]*')
tempF=$(echo "scale=2; 1.8 *$tempC + 32" | bc)
timestamp="$(date)"
printf "%20s%8s\n" "$timestamp" "$tempF"
sleep 2 #How many seconds between each reading
done