shell字符串拼接


  • name="Shell"
  • url="http://c.biancheng.net/shell/"
  • str1=$name$url #中間不能有空格
  • str2="$name $url" #如果被雙引號包圍,那么中間可以有空格
  • str3=$name": "$url #中間可以出現別的字符串
  • str4="$name: $url" #這樣寫也可以
  • str5="${name}Script: ${url}index.html" #這個時候需要給變量名加上大括號

  • 免責聲明!

    本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



     
    粵ICP備18138465號   © 2018-2025 CODEPRJ.COM