'How do you left align a printf on Docker format
I am trying to align a set of docker service ps calls together using printf but it seems to align things on the right when I use printf
for service in $(command docker service ls --format "{{.Name}}")
do
command docker service ps \
--format "table {{ .Name | printf \"%20.20s\" }}\t{{ .Image | printf \"%40.40s\" }}\t{{ .Node | printf \"%20.20s\" }}\t{{.CurrentState}}\t{{.Error}}" \
$service
done
How do I make the printf left align?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
