Blog › Bash · Published 2026-11-26

How to concatenate string variables in Bash

Place variables side by side inside double quotes:

a="Hello"
b="World"
c="$a $b"
echo "$c"

Use braces when text follows a variable name:

echo "${a}_suffix"

Append with +=:

a+=" there"

Always quote variables so spaces are kept.

Official sources

Need help with your project?
We build websites, systems and automation. Start your project WhatsApp

All articles