#!/bin/bash printf "foo\nbar\nbaz" | exec ./test "$@"