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

Did you find this page helpful?