#!/bin/sh set -e echo >&2 "$0: invoked as $0 $*" shift shift exec 3<&0 4>&1 5>&2 >&2 &4 2>&5 & sleep 0.1 env - bash -i ' x "$@"