时间:2021-08-07 08:43:16 | 栏目:Shell | 点击:次
strace -q -eread cp -- "${1}" "${2}" 2>&1 \
| awk '{
count += $NF
if (count % 10 == 0) {
percent = count / total_size * 100
for (i=0;i<=percent;i++)
printf("=");
printf(">");
printf ("%2.0f%%\r", percent);
}
}
END { print "" }' total_size=$(stat -c '%s' "${1}") count=0