cp文件计数

1
2
3
4
5
6
7
8
9
10
#!/bin/bash

FNUM=`ls -alLR testsrc | grep "^-" | wc -l`
echo $FNUM
cp -vrf testsrc testdst | awk '
{
count += 1
printf("%d, %.2f%", count, 100*count/sum)
}
END {print ""}' count=0 sum=$FNUM