0

I would like to parse the result/progress of a running cdrecord -v burn process. What I tried so far was cdrecord -v dev=/dev/sr0 -data foo.iso 2>&1 | grep -E 'Track [0-9]+:.*written'.

Unfortunately, the command above won't show anything until the burning is completed. I think this is due to the fact that cdrecord/wodim uses a carriage return (CR) in order to show the progress in the same line.

At the end of the burning process, only the following line is shown:

Track 01: Total bytes read/written: 98211840/98211840 (47955 sectors).

Is there any way to grep this kind of information?

Any hint appreciated!

mefiX
  • 101
  • 2

1 Answers1

0

tr did the trick!

cdrecord -v dev=/dev/sr0 -data foo.iso 2>&1 | tr '\r' '\n' | grep -E 'Track [0-9]+:.*written'

mefiX
  • 101
  • 2