`

Shell Usage Sample

 
阅读更多

 Sample 1:

if [ $# -ne 1 ]

then

        echo "Usage: `basename $0` {INTG|UA}"

        exit -1

else

        INPUT=`echo $1 | tr '[:lower:]' '[:upper:]'`

        if [ "$INPUT" = "UA" ]; then

                DBCONNECT_STRING=$DBCONNECT_STRING_CORP_POS_UAT

        elif [ "$INPUT" = "INTG" ]; then

                DBCONNECT_STRING=$DBCONNECT_STRING_CORP_POS_INTG

        else

                echo "Unkown parameter: $1"

                exit -1

        fi

fi

 

Sample 2:

if [ $# -ne 2 ]

then

echo "Usage: `basename $0` {PORT-NUMBER} {MBEAN-NAME}"

exit -1

else 

RET=`expr match $1 "[0-9]*$"`

 

        if [ "$RET" -gt 0 ]; then

                       echo "Port number is: $1"

        else

echo "Invalid port number: $1"

exit -1

               fi

echo "MBean name is: $2"

fi

分享到:
评论

相关推荐

    kn-plugin-sample:可以用作蓝图的示例Kn插件

    重要的 该存储库应该用作创建自己的插件的蓝图。 有关如何启动插件的信息,请参见 。...Usage: kn sample [command] Available Commands: help Help about any command print Print the argument version

    python脚本内运行linux命令的方法

    本文实例讲述了python脚本内运行linux命令的方法。分享给大家供大家参考。具体实现方法如下: ...#Sample usage a = RunCmd() a.cmd_run('ls -l') 希望本文所述对大家的Python程序设计有所帮助。 您可能感

    CompTIA.Linux.LPIC-1.Cert.Guide.07897545

    Two full sample exams offer realistic practice delivered through Pearson's state-of-the-art PCPT test engine Table of Contents Chapter 1 Installing Linux Chapter 2 Boot Process and Runlevels Chapter 3...

    Linux高级bash编程

    参数替换和"usage"messages 9-16. 变量长度 9-17. 参数替换中的模式匹配 9-18. 重命名文件扩展名 9-19. 使用模式匹配来分析比较特殊的字符串 9-20. 对字符串的前缀或后缀使用匹配模式 9-21. 使用declare来指定变量...

    Advanced Bash-Scripting Guide <>

    参数替换和"usage"messages 9-16. 变量长度 9-17. 参数替换中的模式匹配 9-18. 重命名文件扩展名 9-19. 使用模式匹配来分析比较特殊的字符串 9-20. 对字符串的前缀或后缀使用匹配模式 9-21. 使用declare 来指定变量...

    码头工人

    您还可以在sample存储库中找到这些脚本的样本用法。 用法 Usage: mid COMMAND Make and run projects (typically system dependent ones, e.g. C/C++ ones) in Docker containers Options: --help print usage --...

    VST SDK 3.612

    VST 3 Plug-in library could export multiple Plug-ins and in this way replaces the shell concept of VST 2 (kPlugCategShell). 12. Support Remote control Representation VST 3 Plug-in can deliver a ...

    remoto-it:普通旧式Bash(POB)脚本以执行远程IT管理

    $ ./run.sh Usage: run.sh &lt;user&gt; &lt;host&gt; [command | recipeFilePath]介绍RemotoIT是执行服务器管理的普通老式Bash(POB)脚本。 目前,它已经在OSX / Ubuntu中作为客户端进行了测试,并在Ubuntu / Solaris中作为...

    ora分析脚本

    sample usage: # ora webplan 4019453623 print more information (decorate 1) # ora webplan 4019453623/1 1 more information, overload! (decorate 2) # ora webplan 4019453623/1 2 using sql_id along ...

    The Art of Assembly Language Programming

    Some Final Comments on the MOV Instructions &lt;br&gt;4.9 Laboratory ...SHELL.ASM File 4.9.4 Assembling Your Code with MASM 4.9.5 Debuggers and CodeView' 4.9.5.1 A Quick Look at CodeView 4.9....

    i-vector的工具箱

    String arguments, either for a file name or a numerical value, are useful when these tools are compiled and called from a shell command line. This makes it easy to use the tools on machines with ...

    Practical Mod Perl

    A Sample Apache::Registry Script Section 2.7. A Simple mod_perl Content Handler Section 2.8. Is This All We Need to Know About mod_perl? Section 2.9. References Chapter 3. ...

    hadoop_the_definitive_guide_3nd_edition

    A Sample Import 527 Generated Code 530 Additional Serialization Systems 531 Database Imports: A Deeper Look 531 Controlling the Import 534 Imports and Consistency 534 Direct-mode Imports 534 Working ...

    EurekaLog_7.5.0.0_Enterprise

    7)....Added: Streaming unpacked debug info into temporal files instead of memory - this greatly reduces run-time application memory usage at cost of slightly slower exception processing. This also ...

Global site tag (gtag.js) - Google Analytics