(bash) mapfile

This commit is contained in:
2026-08-11 10:22:11 +02:00
parent 3627aa5fcb
commit 99dba0971f
+7 -20
View File
@@ -1,24 +1,11 @@
#!/usr/bin/env bash #!/usr/bin/env bash
function print_progress { mapfile -t array <<EOF
bar='[ ' helo there
for ((k = 0; k < 32; k++)); do how do you do
if ((k < (32 * ($2 + 1) / $1))); then blargh=10
bar+='#' EOF
else
bar+=' '
fi
done
bar+=' ]'
echo -ne "\r${bar}"
}
files=($(find . -name "*.zig")) for item in "${array[@]}"; do
echo "${item}"
echo "${#files[@]}, ${#files}, ${files[@]}"
for n in "${!files[@]}"; do
echo "${files[$n]}"
print_progress ${#files[@]} $n
sleep 1
done done