I've never used cygwin, but normally I'd do something like this:
xargs -a <(echo boo hoo) ./fn.sh
-a
tells xargs to read from a file, and the <( )
syntax (which might or might not work with cygwin) is process substitution, which effectively creates a named object (either a named pipe or a path starting /dev/fd
) which can be read, yielding the result of running the enclosed command.
That's not as convenient as pipe syntax, since you have to put the data source in the middle of the xargs
command, but it's otherwise equivalent.