How to concatenate string variables in Bash

后端 未结 30 1511
攒了一身酷
攒了一身酷 2020-11-22 03:40

In PHP, strings are concatenated together as follows:

$foo = \"Hello\";
$foo .= \" World\";

Here, $foo becomes \"Hello World\"

30条回答
  •  盖世英雄少女心
    2020-11-22 04:03

    I do it this way when convenient: Use an inline command!

    echo "The current time is `date`"
    echo "Current User: `echo $USER`"
    

提交回复
热议问题