#!/usr/bin/env bash set -x term_handler() { exit 143; # 128 + 15 -- SIGTERM } trap 'kill ${!}; term_handler' SIGTERM tail -f /dev/null & wait ${!}