比较三个数的大小

vim rather.sh
#!/bin/bash
read -p "first number:" A
read -p "second number:" B
read -p "third number:" C
if [ $A -ge $B ];then
  MAX=$A
else
  MAX=$B
fi
if [ $MAX -le $C ];then
  MAX=$C
fi
echo "The max is $MAX"

你可能感兴趣的:(职场,休闲,比较三个数的大小)