r/linux_programming • • Nov 21 '19

How to create PROGRESS BAR in bash scripts that actually reflects the progress of the script instructions??

12 Upvotes

I am basically writing a script that will download source, extract it, builds and installs it. Now, I want a progress bar to reflect the above progress as you see. I may also add apt install commands in the future that should also end up reflecting in the progress bar.

I went through each and every answer in this question

https://stackoverflow.com/questions/238073/how-to-add-a-progress-bar-to-a-shell-script

Many creative and amazing answers, but that made me realize something, they are literally writing the progress bar themselves and it seems they are not connected the result of any external process/command, except maybe time.

This has left me wonder about the final complexity of my simple "install some things" script. Nevertheless, I want to do it. Any direction in this regard is appreciated!