count脚本
#!/bin/shnumOfArgs=$#if [ $numOfArgs -ne 1 ]; then echo -e "Usage: bash $0 dirForCount" exit -1fi# argsROOTDIR=$1# core partfind $ROOTDIR -maxdepth 1 -type d | sort | while read dir; docount=$(find "$dir" -type f | wc -l)echo "$dir: $count"done
执行
$ bash count.sh benchmarkbenchmark: 2317benchmark/0: 20benchmark/1: 891benchmark/2: 65benchmark/3: 13benchmark/4: 1328
总结
以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,谢谢大家对网页设计的支持。如果你想了解更多相关内容请查看下面相关链接