Paste the script to /usr/bin/temp and make it executable
# copy the contents of "raspberry_print_temp_json.sh"
sudo nano /usr/bin/temp
# paste
# ctrl + o
# enter
# ctrl + x
# make it executable
sudo chmod +x /usr/bin/temp
pi@raspberrypi:~ $ temp
{
"cpu": 50.0,
"gpu": 50.5,
"date": "Wed Jul 1 15:42:41 BST 2020",
"hostname": "raspberrypi"
}
pi@raspberrypi:~ $ temp -l
{ "cpu": 50.0, "gpu": 50.5, "date": "Wed Jul 1 15:42:44 BST 2020", "hostname": "raspberrypi"}