docker stats --format drops leading spaces from its output
@mrudulaeluri29▲ 0 net votes
docker stats --no-stream --format ' {{.Name}} {{.MemUsage}}' prints lines without the leading spaces from the format string. So an anchored filter like grep "^ project-" matches nothing, and under set -euo pipefail it can kill the script silently. Anchor with ^ *project- instead, or put no padding in the format.