# need suggestion how to use the progress bar while executing shell

**URL:** <https://community.unix.com/t/need-suggestion-how-to-use-the-progress-bar-while-executing-shell/313035>\
**Category:** Shell Programming and Scripting\
**Created:** [July 5, 2012, 5:09am UTC](https://community.unix.com/t/need-suggestion-how-to-use-the-progress-bar-while-executing-shell/313035 "2012-07-05T05:09:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![manas\_ranjan](https://community.unix.com/user_avatar/community.unix.com/manas_ranjan/32/598_2.png) [@manas\_ranjan](https://community.unix.com/u/manas_ranjan)\
**Post date:** [July 5, 2012, 5:09am UTC](https://community.unix.com/t/need-suggestion-how-to-use-the-progress-bar-while-executing-shell/313035/1 "2012-07-05T05:09:10Z")

</div>

Dear All,

I need suggestions, I have below simple text based progress-bar script which will gradually increase the %.

```nohighlight
#!/bin/ksh
i=50
echo "0--------20--------40-------60--------80-------100%"
while [$i -ge 0]
do
echo -n "#"
sleep 1
i=`expr $i - 1`
done
echo

```

Now my problem is, how can I simultaneously use this with my wget functionality .

e.g. if I'm trying to execute wget and it takes normally 2-3min due to heavy file downloading, so instead showing blank screen I want to use this text bar that download is on progress..

how can I achieve this simultaneous execution ??

e.g.

```nohighlight
Type MTM Date:<YYYYMMDD>
20120702
Started fetching 20120702 from www.xxx.zzz...
0--------20--------40-------60--------80-------100%
#############################

```

---

<div class="post-metadata">

**Author:** ![drl](https://community.unix.com/user_avatar/community.unix.com/drl/32/542_2.png) [@drl](https://community.unix.com/u/drl)\
**Post date:** [July 5, 2012, 9:41am UTC](https://community.unix.com/t/need-suggestion-how-to-use-the-progress-bar-while-executing-shell/313035/2 "2012-07-05T09:41:35Z")

</div>

Hi.

Is there some reason that you do not use wget internal progress? As in:

```nohighlight
       --progress=type
           Select the type of the progress indicator you wish to use. Legal
           indicators are "dot" and "bar".
-- excerpt from man wget

```

cheers, drl

---

<div class="post-metadata">

**Author:** ![manas\_ranjan](https://community.unix.com/user_avatar/community.unix.com/manas_ranjan/32/598_2.png) [@manas\_ranjan](https://community.unix.com/u/manas_ranjan)\
**Post date:** [July 9, 2012, 5:49am UTC](https://community.unix.com/t/need-suggestion-how-to-use-the-progress-bar-while-executing-shell/313035/3 "2012-07-09T05:49:42Z")

</div>

Hi drl,

thank you, I know I sounded like I want to use the bar for wget but actually  
I meant wget as an example, but there are loads other option/scripts where I need to use/call/execute simultaneously two shells like copy a heavy one/execute a script and then same time display the bar.......while one thing is in progress ....

---

<div class="post-metadata">

**Author:** ![drl](https://community.unix.com/user_avatar/community.unix.com/drl/32/542_2.png) [@drl](https://community.unix.com/u/drl)\
**Post date:** [July 9, 2012, 6:50am UTC](https://community.unix.com/t/need-suggestion-how-to-use-the-progress-bar-while-executing-shell/313035/4 "2012-07-09T06:50:26Z")

</div>

Hi.

I have used pv with success:

```plaintext
NAME
       pv - monitor the progress of data through a pipe
-- excerpt from man pv, q.v.

```

and pv was in my Debian repository.

You might also be able to use bar:

```plaintext
# @(#) bar Copy file as with cat, show progress bar to STDERR.
# See http://www.theiling.de/projects/bar.html

```

There are a lot of other progress mechanisms. I don't recall if any will simply monitor a process -- those might be useful when you you cannot use a pipeline, for example, but would probably use a spinner to show that the process was still active.

Good luck ... cheers, drl

---------- Post updated at 05:50 ---------- Previous update was at 05:25 ----------

Hi.

There are a number of progress suggestions at [BASH progress basr or animation](http://www.linuxquestions.org/questions/programming-9/bash-progress-basr-or-animation-565730/) ... cheers, drl
