返回顶部

收藏

重复执行某个命令的shell脚本

更多
#!/bin/sh

if [ "$1" = "" ]
then
    echo "代码片段CodeSnippet.cn"
    exit 1
fi

while [ 1 ]
do
    $1
    if [ "$?" = "0" ] && ( [ "$2" = "cr" ] || 
       [ "$2" = "-cr" ] || 
       [ "$2" = "--cr" ] || 
       [ "$2" = "--checkresult" ] )
    then
        echo "ִCodeSnippet.cn!"
        exit 0
    fi
done

exit 0
#该片段来自于http://outofmemory.cn

标签:shell,基础

收藏

0人收藏

支持

0

反对

0

发表评论