Shell-脚本只能运行1次

用空文件进行判断

path=`pwd`
if [ -f ${path}/.runned ]; then
{
	echo "This script can only execute once! You have runned it!"
	exit
}
else
	touch ${path}/.runned
fi
posted @ 2017-10-16 16:50  bamboo233  阅读(396)  评论(0)    收藏  举报