T
Task7mo ago
Nargit

docker --format {{ .Name }}

Hello, how to escape {{ }} from taskfile to use a variable like define using for example docker format ? vars: CONTAINERS: sh: docker ps --format "{{ .Names }}" Taskfile is evaluating {{ .Names }} and I cannot find a clean way to escape {{ and }}
3 Replies
Nargit
NargitOP7mo ago
My workaround right now it to use
"<< .Names >>" | replace "<" "{" | replace ">" "}" | quote
"<< .Names >>" | replace "<" "{" | replace ">" "}" | quote
peini7
peini77mo ago
Thx, clever workaround. I will also try this for my problem.
andreynering
andreynering7mo ago
I think this does the trick:
{{"{{"}}
{{"}}"}}
{{"{{"}}
{{"}}"}}

Did you find this page helpful?