On 25.03.10 21:30, Peter Korsgaard wrote:
"Michael" == Michael Hagedorn<[email protected]>  writes:
  Michael>  Is there an easy way to disregard lines that contain only control
  Michael>  characters or filter the text?

Sure, just use sed on the output from the serial port.

Busybox sed doesn't seem to handle escape characters so you cannot just
do sed 's/\r//', but you can use printf:

sed "s/$(printf '\r')//"


Hi

Thanks a lot. I tried this:

cat /dev/ttyUSB0 | sed "s/$(printf '\r')/foundHere/"

and this

cat /dev/ttyUSB0 | sed "s/$(printf '\x0D')/foundHere/"

but it didn't work (output stayed the same). I tried it with some string that appears in the message and that worked.
I wonder if the printf doe something to the '\r'.

Any advise?


_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to