shell腳本介紹與基本使用(四)

流程控制語句 if/else命令 1.單分支if條件語句 ​ if [ 條件判斷式 ] ​ then ​ 程序 ​ fi ​ 或者 ​ if [ 條件判斷式 ];then ​ 程序 ​ fi ​ ​ eg:#!/bin/sh ​ if [ -x /etc/rc.d/init.d/httpd ] ​ then ​ /etc/rc.d/init.d/httpd restart ​ fi ​ ​ 單分支
相關文章
相關標籤/搜索