Bash – Concatenate Strings

Concatenate Strings in Bash

To Concatenate Strings in Bash, use one of the following techniques.

  1. Using +=   : Append to variable

    Appending str2 to str1. [str1 = str1 + str2]

  2. Keep two string variables side by side

  3. Use a string variable in another string


Conclusion :

In this Bash Tutorial, we have learnt different ways to concatenate strings in Bash Scripting.