Contents ...
udn網路城邦
linux script sh 字串 檢查
2021/11/03 11:43
瀏覽95
迴響0
推薦0
引用0

this line can not set #!/bin/sh XD

===

#!/bin/sh
st1=`sudo fastboot devices`
if [ -z "$st1" ]; then
    echo "no device"
    exit 1
fi


===

#!/bin/sh
aaa="111"
bbb="111"
if [ "$aaa" = "$bbb" ] # space is must
then
    echo ok
else
    echo ng
fi

===

#!/bin/sh
aaa="111"
bbb="111"
if [ -f "/etc/rc.local" ] # space is must
then
    echo ok
else
    echo ng
fi

全站分類:不分類 不分類
自訂分類:linux_sh
上一則: linux sh, list, string array
下一則: exit code 程式 指令 執行結果

限會員,要發表迴響,請先登入