#!/bin/sh usage () { cat <<-'EOF' svlogtail [LOG...] - show svlogd logs conveniently Without arguments, show current logs of all services, uniquely. With arguments, show all logs of mentioned services EOF } if [ $# = 0 ]; then cat /var/log/socklog/*/current | sort -u tail -Fq -n0 /var/log/socklog/*/current | uniq else old= cur= for log; do case "$log" in -*) usage; exit 1;; esac if [ -d /var/log/socklog/$log ]; then old="$old /var/log/socklog/$log/*.[us]" cur="$cur /var/log/socklog/$log/current" else echo "no logs for $log" 1>&2 exit 1 fi done cat $old $cur | sort tail -Fq -n0 $cur fi