I am trying to set a variable, for example cmd = "echo 25"
, but it does not work
{% set cmd = "echo {{ id }}" %}
Please help to fix it.
Try this:
{% set testing = 'it worked' %}
{% set another = testing %}
{{ another }}
Result:
it worked
You have to use the join method to concatenate strings and variables.
{% set module = "XYZ" %}
{% set jarfile = [module, '-jar-with-dependencies.jar']|join %}