Shell编程常用 1.读取目录下的文件,逐个给命令运行 dir=$(ls -l ./ |awk '!/^d/ {print $NF}' |grep -i "sam" ) for i in $dir do ... done