#!/bin/bash cat /dev/stdin | $(cat /dev/stdin > "$1")& quit_proc="$!" sleep 1 kill "$quit_proc"