Eric Bower
·
22 Jul 24
logs.sh
1#!/bin/bash
2
3FILTER=${1:-prose|pastes|imgs}
4
5function _exit {
6 kill $(jobs -p)
7}
8
9trap _exit EXIT
10
11for name in $(docker ps --format "{{.Names}}" | egrep "$FILTER"); do
12 eval "docker logs -f --tail=5 \"$name\" 2>&1 | sed -e \"s/^/[-- $name --] /\" &";
13done
14
15wait