bash echo concatenate string code example
Example 1: concatenate strings bash
VAR1="Hello,"
VAR2=" World"
VAR3="$VAR1$VAR2"
echo "$VAR3"
Example 2: bash concatenate string variables
foo="Hello"
foo="${foo} World"
echo "${foo}"
> Hello World
VAR1="Hello,"
VAR2=" World"
VAR3="$VAR1$VAR2"
echo "$VAR3"
foo="Hello"
foo="${foo} World"
echo "${foo}"
> Hello World