How to concat variable and string in bash script

后端 未结 3 1398
野的像风
野的像风 2020-12-15 21:51

How to concat variable and string in bash script ?

val1 = Variable1 + \"any string \"

eg :

val1 = $i + \"-i-*\"
         


        
3条回答
  •  醉梦人生
    2020-12-15 22:24

    Nice.

    Mac OS X 10.12 works with following ...


    #!/bin/bash
    
    var1=bar
    var2=foo
    var3="$var1"sometext
    echo $var3
    

    Result

    = barfoosometext

提交回复
热议问题