網路城邦
上一篇 回創作列表 下一篇   字體:
linux script sh 字串 檢查
2021/11/03 11:43:01瀏覽93|回應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

( 不分類不分類 )
回應 列印 加入我的文摘
上一篇 回創作列表 下一篇

引用
引用網址:https://classic-blog.udn.com/article/trackback.jsp?uid=greatcat&aid=170189360