在 Shell 脚本中如何比较两个数字?
在 if-then 中使用测试命令( -gt 等)来比较两个数字。例如:#!/bin/bashx=10y=20if [ $x -gt $y ]thenecho “x is greater than y”elseecho “y is greater than x”fi