脚本:
#!/bin/bash for xml in `ls *.xml` do if `grep -q "object" $xml` ;then echo "$xml正常" else echo "$xml不存在object标签,已删除!" #png=`grep "filename"|awk -F '>' '{print $2}'|sed 's#filename##g'|sed 's#<##g'|sed 's#/##g'` name=`echo $xml|awk -F '.' '{print $1}'` #rm -f $xml #rm -f $png rm -f "$name".* fi done