I\'m using a serial device for a project, and what I\'m trying to accomplish PC side, is listening for a command sent by the serial device, interpreting the query, running s
Is this not what you're looking for?
while read -r line < /dev/ttyS2; do # $line is the line read, do something with it # which produces $result echo $result > /dev/ttyS2 done