Quote:
Originally Posted by bryanh
what I would like to do is show a dialog gauge after each record in database is converted to vendor_$idnum.pdf
...
Can anyone help? Also point me to where I could learn more about dialog-seen examples but for me to learn I need alot of examples-
more than one example program to sink into my brain...
|
If you know how programming control works, this real example may help.
It uses Yad (yet another dialog)
YAD is a program that will display GTK+ dialogs (GUI'fied dialogs)
Code:
#!/bin/bash
################################################################
# Name: AWS SnapsCount
# Version: 1310054340
# Author: jj_of_c9
# Date: Thu Jul 07, 2011
# Requirements: yad,ec2-api-tools
# Description: Retrieves AWS Snapshots and counts them.
################################################################
export EC2_HOME=/edit/me
#Local date/time stamp
var1=`date`
yad --image=/home/jj/Documents/cirrhus9/Legal/cirrhus9_logo_blue.png --no-buttons --undecorated --skip-taskbar --timeout=2
function do_work()
{
var3=`echo -n "FTB Snapshots="$(/home/jj/Bin/ec2/bin/ec2-describe-snapshots -K /home/jj/.ssh/domain.com/pem/pk-32CHARACTERS.pem -C /home/jj/.ssh/domain.com/pem/cert-32CHARACTERS.pem --region us-west-1 | sort -r -k 5 | wc -l)`
}
touch /tmp/$$
( ( echo 1 ; while [ -f /tmp/$$ ] ; do sleep 1 ; done ; echo 100 ) | yad --progress --pulsate --auto-close --text="Counting Snapshots..." --width=150 --title="" --undecorated --no-buttons) & do_work
rm /tmp/$$
#output
echo -e "$var1\n$var3"| yad --text-info --show-uri --width=300 --height=265 --center --name="EC2 Snapshots" --window-icon="/home/jj/Documents/favicon.ico" --button=Done
Basically, write a /tmp/$$ and then process the work with do_work() function.
When that's done, remove /tmp/$$
"5) Building a Gauge"
http://mywiki.wooledge.org/BashFAQ/044
http://mywiki.wooledge.org/BashFAQ/040
should get you started, I hope.
Good luck!
subscribed with interest...
JJ