#!/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";
shell脚本获取一个目录、及其子目录下的所有文件
最新推荐文章于 2022-12-31 10:33:27 发布