commit dc5b133c0256b7283523f35c344af00717d05a5b parent d673dac65b10724894f5a8ff8971ff11839f2c03 Author: pyratebeard <root@pyratebeard.net> Date: Thu, 1 Oct 2020 15:16:10 +0100 20 second progress bar Diffstat:
M | README.md | | | 8 | ++++---- |
A | timer | | | 17 | +++++++++++++++++ |
2 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md @@ -1,6 +1,6 @@ ``` - ┬─┐┬─┐┌─┐┬ ┬┬─┐ ┬┌ ┬ ┐┌─┐┬ ┬┬─┐ - │─┘├─ │ │─┤│─┤ ├┴┐│ ││ │─┤│─┤ - ┆ ┴─┘└─┘┆ ┴┘ ┆ ┆ ┘┆─┘└─┘┆ ┴┘ ┆ - 4 0 0 s e c o n d s +┬─┐┬─┐┌─┐┬ ┬┬─┐ ┬┌ ┬ ┐┌─┐┬ ┬┬─┐ +│─┘├─ │ │─┤│─┤ ├┴┐│ ││ │─┤│─┤ +┆ ┴─┘└─┘┆ ┴┘ ┆ ┆ ┘┆─┘└─┘┆ ┴┘ ┆ + 4 0 0 s e c o n d s ``` diff --git a/timer b/timer @@ -0,0 +1,17 @@ +#!/bin/sh + +progress() { + for ((k = 0; k <= 19 ; k++)) + do + echo -n " >" + for ((i = 1 ; i <= k; i++)); do echo -n "###"; done + for ((j = i ; j <= 20 ; j++)); do echo -n " "; done + #v=$((k * 10)) + echo -n "< " + echo -n "$k" $'\r' + sleep 1 + done + echo +} + +progress