Shell教程

Shell if-then-elif

Shell Scripting if then elif

一个新的 if 可以嵌套在 elif 中。
语法:
if then elif 的语法如下图所示,
Shell scripting If then elif 1

示例 if then elif:

我们已经展示了选择颜色的示例。
条件:

if [ $color == Red ]
elif [ $color == Blue ]
Shell scripting If then elif 2
看上面的快照,我们已经展示了脚本。
Shell scripting If then elif 3
看上面的快照,红色颜色转到 if 部分,蓝色 颜色转到 elif 部分,其他颜色转到 else > 部分。
昵称: 邮箱:
Copyright © 2022 立地货 All Rights Reserved.
备案号:京ICP备14037608号-4