ls.sh #!/bin/sh list=`ls` #echo $ls for i in $list do #echo $i #echo $i count=`echo $i | grep -cP ".*html"` #echo $count; #echo $? #exit if [ $count -gt 0 ]; then echo $i fi done 赞 0 赏 分享