在 if-then 中使用测试命令( -gt 等)来比较两个数字。例如:
sh
#!/bin/bash
x=10
y=20
if [ x -gty ]
then
echo “x is greater than y”
else
echo “y is greater than x”
fi
发布者:admin,如若转载,请注明出处:https://ai1024.vip/37532.html