You are not logged in.
Hello to you masters,
I'm writing a bash script that will download and install the Eiffel language on linux, and for this I'm using the dialog utility. I use wget to download the .tgz file from a mirror but instead of wget printing to stdout I'd like 'dialog' to show the progress nicely using the --gauge option. As of now I can get the progress bar to move with something like this:
#!/bin/bash
i=0
while [ $i -le 100 ]
do
echo $i | dialog --gauge "download progress" 10 30
i=`expr $i + 1`
sleep 1
done
but this is not dynamic as you can see...I was trying to grep for wget's output and then pipe that to dialog but nothing seems to work...your help is greatly appreciated.
Offline
Hi,
i can't provide a complete solution but some hints. Write the output of wget in a temporary file
wget -o $tmpfile url
. Read the last two lines
tail -n 2 $tmpfile
and then extract the current persentage with regular expression.
Greets
dojo
Offline
thanks for the reply....one question tho...do I need to exec wget in a subshell?...since I need some mechanism of piping that percent value to dialog --guage from wget...how would you go about doing this? thanks a bunch.
Offline
Subshell could be a solution. Or just background it. 100 percent implies that wget has finished successfull.
Greets
dojo
Offline