Is it possible to use multiple here-docs in bash?
27
votes
4
answers
9579
views
Can one use multiple here-docs to provide input to a command in bash?
$ cat foo
> EOF1
> bar
> EOF2
bar
Obviously, in both cases, the second here-doc is used as stdin, and replaces the first reference. Is the solution to use
echo
s instead?
$ cat <(echo -n foo) <(echo bar)
foobar
Also, for some reason, using a combination didn't work for me. Why would that be?
$ cat <<
Asked by Sparhawk
(20499 rep)
Aug 3, 2014, 11:10 AM
Last activity: Oct 26, 2024, 07:16 AM
Last activity: Oct 26, 2024, 07:16 AM