diff --git a/bash-test.sh b/bash-test.sh index 10b1f29..59301da 100755 --- a/bash-test.sh +++ b/bash-test.sh @@ -1,6 +1,24 @@ #!/usr/bin/env bash -path="$(realpath "${BASH_SOURCE}")" +function print_progress { + bar='[ ' + for ((k = 0; k < 32; k++)); do + if ((k < (32 * ($2 + 1) / $1))); then + bar+='#' + else + bar+=' ' + fi + done + bar+=' ]' + echo -ne "\r${bar}" +} -echo "path: ${path%/*}" -echo "file: ${path##*/}" +files=($(find . -name "*.zig")) + +echo "${#files[@]}, ${#files}, ${files[@]}" + +for n in "${!files[@]}"; do + echo "${files[$n]}" + print_progress ${#files[@]} $n + sleep 1 +done