{/* Build timestamp: 1769283779551 - Forces cache invalidation */}
Last Updated: 1/24/2026
Template Variables Test
This document tests various template variable syntaxes used in different languages and tools.
Shell/Bash Variables
Set the path with $HOME/projects or ${HOME}/projects.
Use ${VAR_NAME} for variable expansion.
Default values: ${VAR:-default} or ${VAR:=default}
String operations: ${VAR#pattern} and ${VAR%pattern}
Environment Variables
Configure with $DATABASE_URL for the connection string.
The $NODE_ENV should be “production” or “development”.
AWS credentials: $AWS_ACCESS_KEY_ID and $AWS_SECRET_ACCESS_KEY
JavaScript Template Literals
In JavaScript, use ${variable} inside backticks for interpolation.
Example: Hello, ${user.name}! You have ${count} messages.
Expressions work too: Total: ${price * quantity}
Mustache/Handlebars Templates
Use {{variable}} for Mustache templates.
Sections: {{#items}}…{{/items}}
Inverted sections: {{^items}}No items{{/items}}
Partials: {{> partial_name}}
Jinja2/Django Templates
Variables: {{ variable }}
Filters: {{ name|lower }}
Tags: {% if condition %}…{% endif %}
Comments: {# This is a comment #}
ERB (Ruby) Templates
Output: <%= expression %>
Execute: <% code %>
Comment: <%# comment %>
Terraform/HCL Variables
Reference: ${var.region}
Local: ${local.name}
Data: ${data.aws_ami.id}
Kubernetes/Helm Values
Values: {{ .Values.image.repository }}
Release: {{ .Release.Name }}
Chart: {{ .Chart.Version }}
GitHub Actions
Secrets: ${{ secrets.GITHUB_TOKEN }}
Context: ${{ github.repository }}
Expressions: ${{ steps.step_id.outputs.result }}
Mixed Examples
A complex template might have ${shell} and {{mustache}} and {simple} all together.
Or even {{ jinja }} with ${bash} in the same document.