#!/usr/bin/env bash # Captures stdin to a temp file while passing through OUT_FILE="$1" cat | tee "$OUT_FILE"