I have been working on a Bash script to beep when the PC is too hot. I have removed the beep to try identifying the problem. What I have so far:
temp=$(sysctl -n hw.acpi.thermal.tz0.temperature | tr -d 'C')
echo $temp
if ["$temp" -gt "30.1"]
then
echo "temp hot"
else
echo "temp ok"
fi
My output is
54.1
temp.sh: line 4: [54.1: command not found
temp ok
Removing the if
statement just outputs
54.1
so I think it's the if
statement that's not working.