1 #!/bin/sh 2 3 export DS_DIR=/home/cxy/test 4 5 if [ ! -d $DS_DIR ]; then 6 mkdir $DS_DIR 7 else 8 echo "$DS_DIR is not existed!" 9 fi10 11 cd $DS_DIR12 if [ $(ls -l | grep "install-*" | wc -l) > 3 ]; then13 echo "more than 2 dst_files in $DS_DIR"14 rm -r $(ls -rt | head -n2)15 fi