T
Task4w 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
NargitOP4w ago
My workaround right now it to use
"<< .Names >>" | replace "<" "{" | replace ">" "}" | quote
"<< .Names >>" | replace "<" "{" | replace ">" "}" | quote
peini7
peini74w ago
Thx, clever workaround. I will also try this for my problem.
andreynering
andreynering4w ago
I think this does the trick:
{{"{{"}}
{{"}}"}}
{{"{{"}}
{{"}}"}}

Did you find this page helpful?