#! /bin/sh
echo "Enter the first number: "
read a
echo "Enter the second number: "
read b
if [ $a -eq $b ]
then
echo "$a is larger Number"
else
echo "$b is larger Number"
fi
使用基本计算器命令bc
怎么样?
#! /bin/sh
echo "Enter the first number: "
read a
echo "Enter the second number: "
read b
if (( $(echo "$a > $b" |bc -l) )); then
echo "$a is larger Number"
else
echo "$b is larger Number"
fi