Progress indicator script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Progress indicator script
# 8  
Old 10-03-2008
Thank you nua7 and era. I could recall my favourite dialog boxes in my UX Box now...
# 9  
Old 10-03-2008
The alarm disciple function of ksh93 can be used to output a progress bar as the following simple example shows:
Code:
#!/usr/bin/ksh93

alarm -r progressbar +1

progressbar.alarm()
{
   tput cup 2 10
   (( ++progressbar.pvalue > 50 )) && {
      tput cup 2 10; tput el
      progressbar.pvalue=0
   }
   printf "Progress: %s" "${progressbar.pstr:1:${progressbar.pvalue}}"
}

progressbar.pvalue=0
progressbar.pstr="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

tput clear
read dummy        # dummy wait - press return to exit
tput clear

exit 0

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell Script and Progress Bar or GUI Wrapper

Hi, I have shell script that I am running under Ubuntu as root. Is it possible to hide the command window and show the user some sort of progress /random progress bar / or other form of GUI interaction? On MAC, I have been using Platypus but on Ubuntu I am not sure what to do. (4 Replies)
Discussion started by: naveedanwar4u
4 Replies

2. Programming

Script to monitor progress of find/exec command

hi all, i want to monitor the progress of a find and exec command, this is the code i use - find . -type f -exec md5sum {} \; >> /md5sums/file.txt this command works and produces a text file with all the md5sums but while running it doesnt show the progress is there anyway i can do this... (4 Replies)
Discussion started by: robertkwild
4 Replies

3. Programming

Program or bash script to see total progress of copy

hi all, i want a program or to make a bash script to find out the total ETA/percent (would be nice aswell a progress bar) of a copy recursive command so lets say i do - cp -r /source_folder/ /destinatation_folder/ and when i run it i get no information on the screen of how the copy is... (20 Replies)
Discussion started by: robertkwild
20 Replies

4. Shell Programming and Scripting

progress bar in ftp script

dear all , i made script to transfer data through the FTP but i need to add something if you can help me i want in the output message like progress bar |||||||||||||||||||||||||| 30% to know when it will finish (3 Replies)
Discussion started by: maxim42
3 Replies

5. Shell Programming and Scripting

Protecting variable indicator ($) from expansion

Hello, I use a lot this command to edit a bunch of files at once find . -name filename" | xargs -ifoo sh -c 'echo foo ; sed "s/pattern1/pattern2/" foo > ./tmp ; mv -f ./tmp foo' I'm trying to put a function on my .bashrc file. function loopSed() { local filename=$1 local... (2 Replies)
Discussion started by: phollox
2 Replies

6. UNIX for Advanced & Expert Users

Command to output ones (like zero-fill), with progress indicator

Well, I was originally going to post this snippet in the original thread titled "how to output ones endlessly like /dev/zero", but that topic was closed without an efficient answer. It was difficult to find (build) a satisfactory answer to this one, so I thought I'd share it here and as a "fill... (1 Reply)
Discussion started by: Gliktch
1 Replies

7. Shell Programming and Scripting

Process indicator with hash marks

Hi Experts, I have written a php script that calls several smaller bash shell scripts throughout it's loop process. Users run this script to achieve a task that this script has automated. However this script depending upon the amount of input variables could take some time to run. It may be a... (5 Replies)
Discussion started by: jaysunn
5 Replies

8. Shell Programming and Scripting

Monitoring awk script progress

Is there a way to have awk output its regular output to a file and some other stuff to a log file to monitor progress? ie: print first field of a file and for every 100000 lines dealt with, print time in file.log (2 Replies)
Discussion started by: FrancoisCN
2 Replies

9. Shell Programming and Scripting

Making a progress gauge in a bash script

Hello once again: One thing that seems to be a nice feature is a progress gauge... so I can see how long an operation will take for a task to complete if it is requiring a lot of processing or the file is enormous. I have seen references to gauge operations, but I don't know anything about it or... (1 Reply)
Discussion started by: ccox85
1 Replies
Login or Register to Ask a Question