test.sh

#!/bin/bash
read -p ""  a
read -p ""  b

if [ $a -eq $b ];then
    echo "="
elif [ $a -gt $b ];then
    echo ">"
elif [ $a -lt $b ];then
    echo "<"
fi

输出

bogon:Desktop macname$ ./test.sh 
2
6
<
bogon:Desktop macname$ ./test.sh 
6
2
>
bogon:Desktop macname$ ./test.sh 
6
6
=

 

 

参考:

https://www.cnblogs.com/jw15327/p/6114886.html

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
  • 2021-09-07
  • 2021-11-29
  • 2021-06-10
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-22
  • 2021-07-02
  • 2021-06-03
  • 2022-12-23
  • 2021-10-18
相关资源
相似解决方案