Weird thing in redirecting stdout and stderr
Hi... I'm trying to redirect the progress percentage of the mkisofs command to a zenity window... the thing is, mkisofs prints the xx% to the stderr... so what I'm trying to do is:
Code:
mkisofs options ../filename.iso . 2>&1 | grep done Code:
mkisofs options ../filename.iso . 2>&1 | grep done | awk '{print $1}' Code:
mkisofs options ../filename.iso . 2>&1 | grep done > foo what am I doing wrong? |
it is working, but the numbers are printed almos all at once at the end of iso building.
|
Might be line buffering by grep. Try to use grep --line-buffered
I had a similar issue and matir suggested the above. |
All times are GMT -5. The time now is 08:28 PM. |