We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 85c0494 commit b79e851Copy full SHA for b79e851
compose/bin/docker-stats
@@ -1,10 +1,10 @@
1
#!/usr/bin/env bash
2
3
-container_ids=$(bin/docker-compose ps -q)
+IFS=$'\n' read -d '' -r -a container_ids < <(bin/docker-compose ps -q)
4
5
-if [ -z "$container_ids" ]; then
+if [ ${#container_ids[@]} -eq 0 ]; then
6
echo "No active containers found"
7
exit 1
8
fi
9
10
-docker stats "$container_ids"
+docker stats "${container_ids[@]}"
0 commit comments