簡體   English   中英

運行腳本時輸出不返回任何內容

[英]output returns nothing when running script

當我運行此腳本時,我什么也沒有返回。 有什么建議么? 這是代碼。

securityTlsVersion() {
     local file="/usr/lib/firefox/mozilla.cfg"
     local config=`more $file|grep security.tls.version.max`
     local tlsmax="lockPref(\"security.tls.version.max`
     if [ "`hostname`" == "server1" ] || [ "`hostname`" == "server2" ];then
       if [ "$config" = "" ]; then
         echo "Adding security.tls.version.max line to mozilla.cfg"
         echo "tlsmax >> $file
         echo "security.tls.version.max is now configured"
       else
         echo "security.tls.version.max is already configured"
       fi
     fi
 }

下面是shellcheck的結果。 這意味着第一行包含未關閉的" 。正如@JNevill所寫,這是從local tlsmax開頭的行:

shellcheck myscript.sh 

In myscript.sh line 7:
     if [ "`hostname`" == "server1" ] || [ "`hostname`" == "server2" ];then
        ^-- SC1009: The mentioned parser error was in this test expression.
          ^-- SC1073: Couldn't parse this double quoted string.
           ^-- SC1072: Expected end of double quoted string. Fix any mentioned problems and try again.

有幫助嗎?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM