Linux下从命令行下读入两个数字并比较大小相关代码:
#!/bin/bash
echo "Please input number a:"
read a
echo "Please input number b:"
read b
if [ "$a" -eq "$b" ]
then echo "$a equals $b"
elif [ "$a" -gt "$b" ]
then echo "$a is greater than $b"
else
echo "$a is less than $b"
fi