I am trying the parse the progress bar output of rsync command. I want to use the percentage data from the rsync progress bar and display it on a dialog gauge utility.
The rsync progress bar data looks like:
32768 0% 0.00kB/s 0:00:00
330563584 8% 315.22MB/s 0:00:11
So far, I have tried sed to extract the data:
rsync -a --progress test.tar.gz /media/sdb1 \
| sed -u -E 's/(^|.*[^0-9])([0-9]{1,3})%.*/\2/p'
I am able to obtain the final value 100 alone. I am not able to obtain the intermediate values.