#!/bin/bash # Wrapper script to prefix output with program name PROGRAM_NAME="$1" shift exec "$@" 2>&1 | stdbuf -oL -eL sed "s/^/[$PROGRAM_NAME] /"