用空文件进行判断path=`pwd` if [ -f ${path}/.runned ]; then { echo "This script can only execute once! You have runned it!" exit } else touch ${path}/.runned fi