linux shell脚本之if判断
无论什么编程语言都离不开条件判断。SHELL也不例外。 if list then do something here elif list then do another thing here else do something else here fi EX1: #!/bin/sh SYSTEM=`uname -s` #获取操作系统类型,我本地是linux if [ $SYSTEM = “Linux” ] ; then #如果是linux的话打印linux字符串 echo “Linux” elif [ $SYSTEM = “FreeBSD” ] ; then echo “FreeBSD” elif [ $SYSTEM = “Solaris” ] ; then…