(bash) mapfile
This commit is contained in:
+7
-20
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user