Concat strings in a shell script [duplicate] Concat strings in a shell script [duplicate] bash bash

Concat strings in a shell script [duplicate]


How about this:

var="${var}string"


It depends on the shell, but since question was tagged bash:

var='my'var=$var'string'


No. For various reasons.

# most sh-compatible shellsvar="my"var="$var string"# advanced shellsvar="my"var+=" string"