gt.sh
时间:2010-12-17 来源:xyqcuijia
输入三个数,比较大小
#!/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
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
相关阅读 更多 +