shell脚本:使用if-then语句和test命令

1、基本结构化命令if-then语句格式: if command then command fi bash shell的if语句会运行if后面的那个命令。若是该命令的退出状态码是0(该命令成功运行),位于then部分的命令就会被执行。若是该命令的退出状态码是其余值,then部分的命令就不会被执行。 fi语句用来表示if-then语句到此结束。web #! /bin/bash if pwd
相关文章
相关标签/搜索