---
title: "get the max num  in bash language"
author: "luogen33"
date: "2011-09-06T23:36:49Z"
tags: []
categories: ["编程语言"]
slug: "get-the-max-num-in-bash-language"
draft: false
lastmod: "2011-09-06T23:36:49Z"
id: 1167159
url: "https://luogen33.iteye.com/blog/1167159"
---

#!/bin/bash 
#get the max num 
echo; 
echo "------test get the max num of two nums----- "; 
EQUAL=0; 
E_PARAM_ERR=-9999; 
max2() 
{ 
if  
then 
echo $E_PARAM_ERR; 
return; 
fi 
if  
then 
echo $EQUAL; 
return; 
else 
if  
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;