1 2 3 4 5 6 7 8 9 10 11 12
#!/bin/sh temp=$(mktemp) "$@" > "$temp" 2>&1 ret=$? if [ $ret != 0 ] then cat "$temp" 1>&2 fi rm -f "$temp" exit $ret