Skip to content

Instantly share code, notes, and snippets.

View mortillan's full-sized avatar
🏠
Working from home

Kian Ortillan mortillan

🏠
Working from home
  • White Cloak Technologies Inc
  • Philippines
View GitHub Profile
@mortillan
mortillan / Demo: String Templates in Bash .md
Created October 14, 2022 06:49 — forked from Jeff-Russ/Demo: String Templates in Bash .md
The best way to create a multiline document template (shell)

Demo: String Templates in Bash

The best way to create a multiline string template variable which has variables within it and contains double quotes.

IMPORTANT: The variable inserts must be assigned before the string template is declared and before it's used! EACH TIME THE INSERTS ARE MODIFIED, THE TEMPLATE MUST BE RE-RECLARED! For this reason it's sometimes handy to put the template def inside a function so you can call/re-call it before using it.