In Linux: use xargs -d'\n' If the -d option isn't available: (input...) | tr '\n' '\0' | xargs -0