【发布时间】:2021-12-02 19:51:05
【问题描述】:
如果我希望我的输出是 - 最大数字是 99,最小数字是 -1
我的 bash 脚本称为 maxmin.sh,它要求输入 5 个数字 (3 15 -1 99 22)
如何在我的 bash 脚本中编写它?
【问题讨论】:
-
man sort、man head和man tail。
标签: linux bash numbers script highest
如果我希望我的输出是 - 最大数字是 99,最小数字是 -1
我的 bash 脚本称为 maxmin.sh,它要求输入 5 个数字 (3 15 -1 99 22)
如何在我的 bash 脚本中编写它?
【问题讨论】:
man sort、man head 和 man tail。
标签: linux bash numbers script highest
在 Bash 中,您应该签入arithmetic context:
if (( a > b )); then
...
fi
【讨论】: