How do I show the progress of a korn-shell script in the form of continuous dots on the screen

Posted on 2010-09-14
Last Modified: 2013-12-26
I have a shell script that calls 2 perl scripts.



Now calls 3 perl scripts within itself to generate the final result through the "system" command.

Is there any way that when I run

ksh A.ksh

when the program is executing, I can show the progress in the form of dots(....)
Question by:sunny82
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 68

Expert Comment

ID: 33677973
I think this is only possible if all of your scripts would echo one or more dots to the terminal (without linefeed, of course) at some stage in their processing.
Your calling script cannot do that on their behalf.

LVL 48

Accepted Solution

Tintin earned 500 total points
ID: 33680119
This should give you the framework you need.

You may need to change

/bin/echo -n .


echo -e ".\c"


echo ".\c"

if the dots don't appear on the same line.

function dots {
  trap 'return' 3

  while true
    /bin/echo -n .
    sleep 1

echo "start"
dots &
kill  $pid
echo finish

Open in new window

LVL 68

Expert Comment

ID: 33680250
Hehe, Tintin,
that's a real "Windows-style" progress meter! Writing a dot every second, regardless of the actual progress ...
Just joking!

Author Comment

ID: 33685591
This is what I was looking for..Thx so much...

Featured Post

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
Over the years I've spent many an hour playing on hardened, DMZ'd servers, with only a sub-set of the usual GNU toy's to keep me company; frequently I've needed to save and send log or data extracts from these server back to my PC, or to others, and…
Six Sigma Control Plans
In a recent question ( here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question