count while animate

This commit is contained in:
2020-01-10 10:42:12 +02:00
parent be44d5aa4c
commit 954a933fcf

View File

@@ -57,7 +57,16 @@ function animate() {
function processfolder() {
SIZECOUNT=( $( find "$@" -type f -printf %s"\n" 2>/dev/null | awk '{ sum += $1; count += 1 } END { print int(sum)+0 , int(count)+0 }' ) )
if [[ "$ANIMATE" -eq 1 ]]; then
SIZECOUNT=( $( \
find "$@" -type f -printf %s"\n" 2>/dev/null | \
awk '{ sum += $1; count += 1; printf " %dMb/%d#\r", sum/(1024*1024), count > "/dev/stderr" } END { print int(sum)+0 , int(count)+0 }' \
) )
echo -e -n "\033[K" >&2
else
SIZECOUNT=( $( find "$@" -type f -printf %s"\n" 2>/dev/null | awk '{ sum += $1; count += 1 } END { print int(sum)+0 , int(count)+0 }' ) )
fi
SIZE=${SIZECOUNT[0]}
[[ "$HUMAN" -eq 1 ]] && {