gt.sh

输入三个数,比较大小
 
#!/bin/bash
if [ $1 -gt $2 ];then
   if [ $1 -gt $2 ];then
      echo "$1 is max."
   else
      echo "$2 is max."
   fi
else
   if [ $3 -gt $2 ];then
      echo "$3 is max."
   else
      echo "$2 is max."
   fi
fi

作者: xyqcuijia   发布时间: 2010-12-17