当前位置: 技术问答>linux和unix
linux中shell比较2个数大小
来源: 互联网 发布时间:2017-04-26
本文导语: #!/bin/sh #输入2个数a,b read a read b if [ a > b ] then echo "a=$a" echo "b=$b" echo "a>b" else echo "a
#!/bin/sh
#输入2个数a,b
read a
read b
if [ a > b ]
then
echo "a=$a"
echo "b=$b"
echo "a>b"
else
echo "a
#输入2个数a,b
read a
read b
if [ a > b ]
then
echo "a=$a"
echo "b=$b"
echo "a>b"
else
echo "a