ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
#### 单分支 ``` if [ 条件 ] then 指令 fi ``` ``` #!/bin/bash # 单 if 语句的使用场景 if [ "$1" == "nan" ] then echo "您的性别是 男" fi ``` #### 双分支 ``` #!/bin/bash if [ "$1" == "nan" ] then echo "男" else echo "女" fi ``` #### 多分支 ``` #!/bin/bash if [ "$1" == "nan" ] then echo "男" elif [ "$1" == "nv" ] then echo "女" else echo "不知道" fi ```