Concat strings in a shell script
BashString ConcatenationBash Problem Overview
How can I concat strings in shell? Is it just...
var = 'my';
var .= 'string';
?
Bash Solutions
Solution 1 - Bash
How about this:
var="${var}string"
Solution 2 - Bash
It depends on the shell, but since question was tagged bash:
var='my'
var=$var'string'
Solution 3 - Bash
No. For various reasons.
# most sh-compatible shells
var="my"
var="$var string"
# advanced shells
var="my"
var+=" string"