zoukankan      html  css  js  c++  java
  • 如何用chkconfig查看手动输入,跳出循环的四个命令

    如何自己加入脚本并可用chkconfig查看

    设置文件名为:case.sh

    #!/bin/bash
    #chkconfig:                35                  90 10

                             在三和五模式中开启

    . /etc/init.d/functions

    case $1 in
            start)
                    action "服务开始启动.." /bin/true
                    ;;
            stop)
                    action "服务准备停止.." /bin/false
                    ;;
            restart)
                    action "服务准备停止" /bin/true
                    action "服务开始启动" /bin/false
                    ;;
            *)
                    echo "请输入正确参数"
                    ;;
    esac

    将文件复制到/etc/init.d/下

    输入命令:chkconfig --add case.sh

                      chkconfig --list case.sh查看

    跳出循环

    exit  直接终止循环

    break  跳出最近的循环圈

    continue   终止本次循环,提前进入下次循环

    return    终止函数的循环,从调用开始循环的地方结束循环,直接跳出函数循环圈

  • 相关阅读:
    Python内置函数(67)——zip
    Python内置函数(66)——vars
    Python内置函数(65)——type
    Python内置函数(64)——tuple
    Python内置函数(63)——super
    Python内置函数(62)——sum
    Python内置函数(61)——str
    Python内置函数(60)——staticmethod
    Hadoop初体验(续)--YARN
    Hadoop初体验
  • 原文地址:https://www.cnblogs.com/mashuang/p/9898223.html
Copyright © 2011-2022 走看看