返回顶部

收藏

重复执行某个命令的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

»更多 您可能感兴趣的代码
  1. 2012-11-05 21:59:42java获得随机数代码 by 怪兽狂殴奥特曼
  2. 2014-04-24 10:59:58Shell创建空文件 by 古殇
  3. 2014-06-05 10:12:43批处理安装配置GCC,MSYS环境 by owensh
  4. 2014-08-01 10:42:55shell shift 用法 by owensh
  5. 2014-09-06 11:16:39PPP连接检查 by Smile_love
  6. 2014-11-11 11:41:42java web 项目发布脚本(Tomcat 版) by zjbpku
  7. 2014-04-25 21:09:33方阵的行和、列和 by zjbpku
  8. 2014-05-19 12:47:46删除Dreamweaver打开文件历史 by owensh
  9. 2014-05-27 10:48:47Powershell并行循环 by 玖夏
  10. 2014-05-30 10:25:11win ngins php 启动重启关闭脚本 by zjbpku
  11. 2014-07-26 09:32:06HAproxy-Keepalived一键安装脚本 by xfk

发表评论