I am trying to store CPU temperature in a variable. I am not sure how to use sed so I am mostly using grep. Here is what I have tried so far, but I am getting syntax error. I am also getting error during the comparison, but I thing it is because CPUTEMP is not resolving.
#!/bin/bash
#
CPUTEMP = $((/usr/bin/sensors k10temp-pci-00c3 | grep temp1 | awk '{print \$2}' | grep -o '[0-9,.]\+'))
if [ "$CPUTEMP" -le 40 ]; then
echo "OK - CPU idle"
exit 0
...
...
fi
What am I doing wrong here? Thank you!