The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Software animation with Pencil iBot UNIX and Linux RSS News 0 04-14-2008 11:10 AM
script animation debit UNIX for Dummies Questions & Answers 0 12-01-2005 09:38 PM
unix.com Flash animation Lazzar What's on Your Mind? 0 07-23-2004 04:22 AM
3d animation aloysius1001 UNIX Desktop for Dummies Questions & Answers 3 02-25-2002 12:30 PM
Graphics And Animation aloysius1001 UNIX Desktop for Dummies Questions & Answers 5 02-15-2002 10:17 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-03-2006
Registered User
 

Join Date: Feb 2005
Posts: 40
Shell Script Animation

Hi,

I want to write a shell script which can do some animation

The animation is as follows

it is like a progress barwhich hould gone on inresing with time & at the end of the line there should be the progess

Eg

== - 10%
==== | 20%
============== / 40%

something like this
(the %age progress is at a constant place the html format is not showing it properly)
can someone help me with this ??
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 04-04-2006
Klashxx's Avatar
HP-UX/Linux/Oracle
 

Join Date: Feb 2006
Location: Almerķa, Spain
Posts: 371
Code:
i=1
b=0
p=0
while [ $i -le 100 ]                                                                                                                                                             
do
   o=1
   while [ $b -ge 0 ]
   do
      echo "\b\c"
      (( b -= 1 ))
   done

   while [ $o -le i ]
   do
   echo "=\c"
   (( o += 1 ))
   done
   b=$(( o + 3 ))
   [ p -eq 3 ] && p=0
   [ p -eq 0 ] && CAR='|'
   [ p -eq 1 ] && CAR='/'
   [ p -eq 2 ] && CAR='\'
   (( p += 1 ))

   echo " ${CAR} $i%\c"
   sleep 1
   (( i += 1 ))
done
Cheers
Reply With Quote
  #3 (permalink)  
Old 04-04-2006
vgersh99's Avatar
Moderator
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 3,002
try this link
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 06:25 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0