I am trying to read line by line from a serial port. The code below works, but I keep getting an error which I do not understand. Any clue?
That's the code
while read line ; do
if [ "$(line)"=='OFF' ] ;
then
echo "that was actually OFF"
fi
done < /dev/ttyACM0
That's the error:
that was actually OFF
./reading_loop.sh: line 9: line: command not found