← All Exercises

Heredoc for Multiline Templates

basicbash~10min

Background

Heredocs provide clean multiline string generation in bash scripts.

Problem

Generate a configuration file from a heredoc template with variable expansion.

Input

Template content with variables

Output

Generated file content

Sample tests

Sample 1

Input: heredoc with $VAR
Expected: expanded content

Your solution

Learning objective

Learn heredoc syntax and template generation