cd /Users/XX/
for folder in `ls`; do
dir="/Users/XX/$folder"
if [ -d $dir ]; then
#echo 'cd $folder'
cd $dir
echo "now in folder:" $folder
cd ..
echo "返回上一级!"
fi
done
cd /Users/XX/
for folder in `ls`; do
dir="/Users/XX/$folder"
if [ -d $dir ]; then
#echo 'cd $folder'
cd $dir
echo "now in folder:" $folder
cd ..
echo "返回上一级!"
fi
done
本文标题:shell脚本遍历文件XX中所有的文件夹
本文链接:https://www.haomeiwen.com/subject/ylbwqktx.html
网友评论