How do I use variables in single quoted strings?

后端 未结 7 1982
既然无缘
既然无缘 2020-11-22 15:40

I am just wondering how I can echo a variable inside single quotes (I am using single quotes as the string has quotation marks in it).

     echo \'test text          


        
7条回答
  •  南笙
    南笙 (楼主)
    2020-11-22 15:59

    with a subshell:

    var='hello' echo 'blah_'`echo $var`' blah blah';
    

提交回复
热议问题