#!/bin/sh # pass all newline-delimited stdin tokens as one argument vector to a single command invocation. IFS=" " args="" while read -r line do args="$args \"$line\"" done eval "$@ $args"