I have been working on a bash script to beep the 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 its the if statement thats not working
Aucun commentaire:
Enregistrer un commentaire