A method to join 2 lines, I had found that splitting was easy, but selectively joining was difficult. Here's my results:
Original input:
/dev/hde:
Timing buffered disk reads: 168 MB in 3.01 seconds = 55.73 MB/sec
/dev/hdi:
Timing buffered disk reads: 168 MB in 3.00 seconds = 55.97 MB/sec
/dev/hdk:
Timing buffered disk reads: 170 MB in 3.05 seconds = 55.78 MB/sec
For me to intelligently grep for good/bad speeds, I need the 2 lines put together. Also this input is kludged up with CRLF (DOS) line terminators:
Solution:
All you need is the inner loop portion, I need the outer loop because I have a bunch of files I'm cycling through in order to get my results. That is an "or" on the grep where I accept lines with "dev" or "Timing".