运维网's Archiver
论坛
›
Shell/Powershell
› Shell if...elif...fi 语句
阿尔哦覅和
发表于 2018-8-25 14:09:38
Shell if...elif...fi 语句
#!/bin/sh
a=10
b=20
if [ $a == $b ]
then
echo "a is equal to b"
elif [ $a -gt $b ]
then
echo "a is greater than b"
elif [ $a -lt $b ]
then
echo "a is less than b"
else
echo "None of the condition met"
fi
页:
[1]
查看完整版本:
Shell if...elif...fi 语句