mirror of
https://github.com/nachoparker/progress_bar.sh.git
synced 2025-11-17 22:33:40 -05:00
Initial commit
This commit is contained in:
35
README.md
Normal file
35
README.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# progress_bar.sh
|
||||
Progress bar for the shell
|
||||
|
||||
Display a progress bar for `$1` seconds.
|
||||
|
||||

|
||||
|
||||
It uses [partial Unicode blocks](https://en.wikipedia.org/wiki/Block_Elements#Character_table) to achieve subcharacter precision.
|
||||
|
||||
Example:
|
||||
|
||||
```
|
||||
source progress_bar.sh
|
||||
progress_bar 60
|
||||
│█████████████████████████████████████████████████████████▌ │ 62%
|
||||
```
|
||||
|
||||
You can time a long task and use it to have an idea of how much longer to wait
|
||||
|
||||
```
|
||||
time ./compile.sh # gives 300 seconds
|
||||
./compile.sh &>/dev/null & progress_bar 300
|
||||
│███████████████████████████████ │ 31%
|
||||
```
|
||||
|
||||
It requires a terminal session with unicode locales, for instance
|
||||
|
||||
```
|
||||
export LC_ALL=en_US.UTF-8
|
||||
export LANG=en_US.UTF-8
|
||||
export LANGUAGE=en_US.UTF-8
|
||||
```
|
||||
|
||||
|
||||
Details at [Own Your Bits](https://ownyourbits.com/2017/07/16/a-progress-bar-for-the-shell/)
|
||||
Reference in New Issue
Block a user