I'm trying to drop the character ^M from my piped command, however, I can't seem to get it to drop.
In one terminal window, I am running
Code:
echo -en "adc read 0\r" > /dev/ttyACM0
which makes my device send back some results with numbers to the same port. To read the returned value, I am in a separate window I am running
Code:
cat -v < /dev/ttyACM0 | grep -v ">"
function that is already cleaning up some of the results, but still allowing ^M to come back. I have tried dropping all but numbers by expanding my cat to
Code:
cat -v < /dev/ttyACM0 | grep -v ">" | tr -dc '[:alnum:]'
, but no luck.
I'm open to ideas on how to drop the two characters that I don't want to see.
Bookmarks