Progress indicator script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Progress indicator script
# 1  
Old 10-02-2008
Progress indicator script

Can anybody suggest you a good script to show progress of a process.

I figured it out some thing like this. But cursor goes to the end of the line and after every loop it goes to the next line.

Code:
while true ; do
for i in \| \/ \- \\ \| \/ \- \\
do
echo "\b\b$i \c"
sleep 1
done
done

# 2  
Old 10-02-2008
The carriage return character (\r, ASCII 13) returns the cursor to beginning of line without advancing to the next line.

If you have printf that might be slightly less unwieldy than echo.
# 3  
Old 10-02-2008
Try echo -n.

Regards
# 4  
Old 10-03-2008
One more way of doing this..

Code:
#!/bin/sh

percent=0
(
while test $percent != 101
do
echo $percent
echo "XXX"
echo "This is how the gauge appears"
echo "XXX"
echo "See how the message changes"
echo "XXX"
percent=`expr $percent + 1`
sleep 1
done
) |
dialog --title "Main Window!" --gauge "This is how a gauge appears on the command line" 10 60 0

# 5  
Old 10-03-2008
It seems This is for Linux. My machine is UX
# 6  
Old 10-03-2008
You can get dialog for HP-UX too. http://hpux.connect.org.uk/hppd/hpux/Shells/dialog-1.1/

(Funny they should use Debian as their upstream, though. According to the corresponding Debian packages, the original upstream is ftp://invisible-island.net/dialog/. I found a home page at http://invisible-island.net/dialog/dialog.html.)
# 7  
Old 10-03-2008
Thank you era!! let me try
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