#!/bin/bash running="$(docker-compose ps --services --filter "status=running")" services="$(docker-compose ps --services)" if [ "$running" != "$services" ]; then # Bash specific RUN=$(comm -13 <(sort <<<"$running") <(sort <<<"$services")) echo "Following_services_are_not_running:" echo "$RUN" else echo "All_services_are_running" fi