Dialog GAUGE - How to display progress of compile? broken pipe problem?
Hi All,
I have been working on script to compile the alsa code on my machine. I wish to create a script to wrap up the installation such that it will display progress bar using the dialog --gauge option instead of just the output. I managed to get the dialog --gauge working using the follow script Code:
############################################################################## Code:
display_progress "tar -jxvf alsa-driver-$ALSA_VERSION.tar.bz2" "1200" "Uncompressing ALSA DRIVER source" "Uncompressing ALSA DRIVER Source ; alsa-$ALSA_VERSION into your hard drive" However When I try to use the command with cvscompile or any other script I can't get the output from that script go all the way through the pipe. It will stop at the second pipe. That's mean Code:
$CMD | awk '{ print $1 }' Code:
$CMD | awk '{ print $1 }' | xargs -n1 echo "$COMPLETE" I hope anyone could explain and help with this program because it's really confusing me Thanks in advance |
I'm not if this helps you, but you can split a pipe in 2 by making a filesystem-pipe ("fifo") and use the "tee" program to write to the fifo while also have the same output flow donw the normal pipe line. Somthing like this:
Code:
mkfifo /tmp/my_fifo |
Thanks HKo for your reply,
It does help however I found out that there's something wrong with the update I did this instead [code] export COMPLETE=1200 ./cvscompile | awk '{ Total +=1; print (Total/ENVIRON["COMPLETE"])*100 }' 1 2 3 4 5 .... (steadily and sequentially [code] However, when I pipe in the output to the "dialog" program, I got a long pause then a suddent rush to 100% Code:
export COMPLETE=1200 |
Hi All!
It's working. For some reason when I woke up this morning I tried this Code:
./cvscompile 2>&1 | awk '{ print (Total+=1)/60.6,"=>",$0}' | dialog --gauge "Compiling..." 7 70 Thanks you guys. |
All times are GMT -5. The time now is 03:23 PM. |