我有這段代碼添加一個鏈接到基於時間戳的目錄中的index.html。 $(tstampm)
是一個生成時間戳的函數。什麼是正確的方式來轉義一個bash變量在HTML中正確擴展?
export tstampm=$(tstampm)
echo 'output from sysuser database - <a href="sysuser/model01-$tstampm"</a> <br />' >> /home/sysuser/docs/dbmodels/index.html
href中的引號會阻止bash變量的擴展。什麼是使其擴展的正確語法?
請注意,href
的雙引號括在echo
命令本身的單引號中。
注:Linux的外殼是完全不知道的HTML – 2014-09-11 12:28:30