LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 08-30-2008, 02:07 PM   #1
Ammad
Member
 
Registered: Apr 2004
Distribution: redhat 9.0, fc4, redhat as 4
Posts: 517

Rep: Reputation: 31
status of running process


i would like to ask the forum, how do i get "###..." hash marks of remaing time/percent of script.

e.g

if a script take 10-25 minutes to complete, end user should see the completion bar on screen.

any idea to this in bash script.

thanks.
 
Old 08-30-2008, 04:12 PM   #2
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
There is no automatic way to do this. You have to program your script to print such output.

Say your scrip iterates over a list of files, it would have to print a parm every so many iterations, so that total bar size will reach the end as the script finishes.

You can move the cursor back to the beginning of the line by printing the right number of backspace characters. This maps it possible to re-draw the bar, but you have to manually keep track of how many backspaces to print.
 
Old 09-01-2008, 01:55 AM   #3
kashifazizawan
Member
 
Registered: Aug 2008
Location: Abbottabad, Pakistan
Distribution: CentOS
Posts: 40
Blog Entries: 13

Rep: Reputation: 15
time ls -a
this will gave you total time in which ls -a command can execute
etc.

time command

do you want this?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Process Status D webee Linux - General 8 02-11-2013 12:12 PM
update-status Process? Harpo Suse/Novell 3 02-04-2009 11:22 AM
how can I monitor all pthread status inside a running process valpa Programming 2 08-26-2008 10:54 PM
Getting a child process status (C) smoothdogg00 Programming 2 04-29-2006 11:49 AM
how to get process status using pid? hongxing Linux - Software 2 04-11-2006 07:11 AM


All times are GMT -5. The time now is 06:12 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration