IT Knowledge Base

Technical Repository

HowTo: Linux Shell Scripting – Concatenate two variables with an underscore.

Wrap each variable in a curly brackets.

#!/bin/bash
_Directory=$/backups/
_FileName=$myfiles.bak
echo ${_Direcotry}_${_FileName})

Output is:

/backups/myfiles.bak



Leave a Reply