shell脚本获取一个目录、及其子目录下的所有文件 末蓝、 2022-12-27 11:22 481阅读 0赞 #!/bin/sh read -p "input path:" FilePath; function getAllFiles() { fileList=`ls $FilePath`; for fileName in $fileList; do #if test -f $fileName; then if [-f $fileName ];then echo $fileName; elif test -d $fileName; then cd $fileName; FilePath=`pwd`; getAllFiles; cd ..; else echo "$FilePath is a invalid path"; fi done } cd $FilePath; getAllFiles; echo "DONE"; 转载地址:[https://blog.csdn.net/wwHRestarting/article/details/52730881?utm\_source=blogxgwz4][https_blog.csdn.net_wwHRestarting_article_details_52730881_utm_source_blogxgwz4] [https_blog.csdn.net_wwHRestarting_article_details_52730881_utm_source_blogxgwz4]: https://blog.csdn.net/wwHRestarting/article/details/52730881?utm_source=blogxgwz4
还没有评论,来说两句吧...