Can I use something like templates with bash?

Bash does not have any native way to use templates. However, depending your actually goals may just evaluating the file with an new bash or shell instance could do the trick.

However, this is discussed on the TemplateFiles-Page