OT?: break up an incoming data stream into fixed length lines? in bash?

Dave Stevens geek at uniserve.com
Fri Apr 6 18:04:08 UTC 2018


I'm using U16.04 to read data from a sensor. The incoming serial data
stream has no newlines, just continuous bytes. In the datastream the
letters B and M occur together at the start of every 24 byte
subsequence. I'm reading the data using getserial with appropriate
speed and parity parms. I don't see a simple way to break it up into
lines with each line having 24 bytes. Does anyone care to suggest a
method? I'd use a bash function if there is one.

TIA,

Dave




More information about the ubuntu-users mailing list