1.使用if_then语句if command then commands fi 先运行if后面的命令,如果命令的退出状态是0(成功执行命令),就将执行then后面,fi前面的所有命令.否则就跳到fi后面继续执行. 2.if-then-else语句if command then commands else commands fi 3.嵌套if语句if command1 then commands elif command2 then commands elif command3 then com…