#!/bin/sh
#check the input if[!-e $1 ]; then
echo "Usage: ./backup filename"
echo "The file must be exit"
exit 1
fi;
#get the max file num
max=0
n=0 for file in `ls /tmp/backup`; do
#n=`echo backupfile1 | sed 's/backupfile//'`
n=${file#backupfile} if[ $n ];then if[ $n -gt $max ] ;then
max=$n
fi
fi
done