`
luogen33
  • 浏览: 82683 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论

get the max num in bash language

 
阅读更多
#!/bin/bash
#get the max num
echo;
echo "------test get the max num of two nums----- ";
EQUAL=0;
E_PARAM_ERR=-9999;
max2()
{
if [ -z "$2" ]
then
echo $E_PARAM_ERR;
return;
fi
if [ $1 -eq $2 ]
then
echo $EQUAL;
return;
else
if [ $1 -gt $2 ]
then
ret=$1;
else
ret=$2;
fi
fi
#can't use the return sentence,in here .
#because the method can return not big 255
echo $ret;

}
num=$(max2 200 500);
echo $num;
echo;
分享到:
评论

相关推荐

    bash-language-server:Bash的语言服务器

    npm i -g bash-language-server 如果遇到安装错误,请确保节点版本为8或更高( node --version )。 客户群 以下编辑器和IDE具有可用的客户端: Visual Studio代码( ) 原子( ) 崇高文字( ) Vim() ...

    Learning the bash Shell

    《Learning the Bash Shell》是一本深受Linux用户喜爱的教程,主要针对Bash shell进行深入讲解。Bash(Bourne-Again SHell)是Linux操作系统中最常用的命令行解释器,它为用户提供了与系统交互的强大工具。这本书的...

    Learning+the+bash+Shell(3rd).chm and Bash Reference Manual.pdf

    Bash is the shell, or command language interpreter, for the gnu operating system. The name is an acronym for the ‘Bourne-Again SHell’, a pun on Stephen Bourne, the author of the direct ancestor of ...

    learning the bash shell

    《Learning the Bash Shell》这本书是深入理解Bash Shell的宝贵资料,涵盖了从基本操作到高级特性的全面教程。通过阅读本书,用户不仅可以掌握Bash Shell的使用,还能进一步提升Linux系统的驾驭能力。 总之,学习...

    docker容器中 bash: vi: command not found,docker apt-get 异常 Temporary failure resolving

    bash: vi: command not found, 场景: 因为 docker里面没有这个命令,我们安装一下 apt-get update apt-get install vim 如果 这个时候 安装也还是会出现 异常 root@446d7cf1606c:/etc/mysql# apt-get update ...

    linux learning the bash shell

    #### 标题:Linux Learning the Bash Shell - **核心概念**:本标题明确指出了学习的目标——Bash Shell。Bash(Bourne Again SHell)是Unix/Linux操作系统中最常用的命令解释器之一,也是大多数Linux发行版的默认...

    Penetration Testing with the Bash shell

    This book teaches you to take your problem solving capabilities to the next level with the Bash shell, to assess network and application level security by leveraging the power of the command-line ...

    Learning The Bash Shell, 3rd Edition by Cameron Newbam & Bill Rosenblatt

    - **书籍名称**:“Learning The Bash Shell, 3rd Edition”(《学习 Bash Shell》第三版) - **作者**:Cameron Newham 与 Bill Rosenblatt 这本书籍是由两位资深 Unix/Linux 系统管理员合作编写的。作为一本介绍 ...

    Learning the bash shell

    学习Bash Shell的经典教材,推荐

    linux-toolbox___linux百宝箱,包含zshapt-get_下载必要包bash_linux-to

    linux-toolbox___linux百宝箱,包含zshapt-get_下载必要包bash_linux-toolbox

    Bash reference Manual

    Bash Features This text is a brief description of the features that are present in the Bash shell (version 3.2, 28 September 2006). <br>This is Edition 3.2, last updated 28 September 2006, of ...

Global site tag (gtag.js) - Google Analytics