Bash: Variable in single quote

后端 未结 3 943
逝去的感伤
逝去的感伤 2020-12-11 07:35

First take a look at this question: Bash or GoogleCL: new line in a string parameter

I want to add a variable ${date} into the \"summary\" now:

googl         


        
3条回答
  •  时光说笑
    2020-12-11 08:23

    Rather than attempting to expand a variable inside a single quoted string, the typical solution is to concatenate single and double quoted strings. In other words:

    'Today is'"${date}"'. Poor' ...
    

提交回复
热议问题