逻辑判断 vim if.sh #!/bin/bash ## ## a= ] then echo "a>3" fi sh if.sh a>3 vim if2.sh #!/bin/bash ## ## a= ] then echo "a>3" fi ] then echo "a>4" fi sh if2.sh sh if2.sh > -ge 大于 < -lt 小于 == -eq 等于 != -ne 不等于 >…
逻辑判断的格式 vim case.sh #!/bin/bash read -p "please input a number:" n m=$[$n%] case $m in ) echo " It is a jishu'" ;; ) echo " It is a oushu." ;; *) echo " Not is a jishu and oushu." esac 输入一串字符 赋值$n $m=$n除以2 判断$m 等于1…
创建一个shell脚本 mkdir shell vim first.sh #!/bin/bash ##The first test shell script. ##Written by wangshaojun. ls /tmp/ echo "my home is $HOME" echo "This is first script" 执行shell脚本,两种方法 bash first.sh mysql.sock www_slow.log2015-12-31.wangs…