运维网's Archiver
论坛
›
Shell/Powershell
› shell 递归目录
santaclaus
发表于 2018-8-25 11:16:39
shell 递归目录
#!/bin/bash
function read_dir() {
for file in `ls $1`
do
if [ "`ls -A $1"/"$file`" != "" -a -d $1"/"$file ]
then
read_dir $1"/"$file
else
echo $1"/"$file
fi
done
}
read_dir $1
页:
[1]
查看完整版本:
shell 递归目录