zoukankan      html  css  js  c++  java
  • 【1.6】shell使用 -p -f 之类的参数

    usage(){
        echo $1
        echo '$#': $#
        action "error" /bin/false
            echo "usage: install_mysql.sh  -F   -f   mysql-x-x.tar.xx  -d /data/mysql  -l /data/mysql_log -b /data/backup -p xxxxx"
    
    }
    
    while getopts :f:d:b:p:l:F opt
    do
            case "$opt" in
                    h) usage && exit ;;
                    f) mysql_tar=$OPTARG ;;
                    d) datadir=$OPTARG ;;
                    l) logdir=$OPTARG ;;
                    b) backupdir=$OPTARG ;;
                    F) force_install=1 ;;
                    p) password=$OPTARG ;;
                    *) usage && exit;;
            esac
    done

    usage(){echo $1echo '$#': $#action "error" /bin/false        echo "usage: install_mysql.sh  -F   -f   mysql-x-x.tar.xx  -d /data/mysql  -l /data/mysql_log -b /data/backup -p xxxxx"
    }
    while getopts :f:d:b:p:l:F optdo        case "$opt" in                h) usage && exit ;;                f) mysql_tar=$OPTARG ;;                d) datadir=$OPTARG ;;                l) logdir=$OPTARG ;;                b) backupdir=$OPTARG ;;                F) force_install=1 ;;                p) password=$OPTARG ;;                *) usage && exit;;        esacdone

  • 相关阅读:
    Hive的架构和工作流程
    Hive的定义及搭建
    HBase API操作
    HBase相关概念简介
    HBase shell常用命令
    HBase的简介和搭建
    scrapy useragent
    scrapy settings
    scrapy中的request对象
    python语法
  • 原文地址:https://www.cnblogs.com/gered/p/14142246.html
Copyright © 2011-2022 走看看