help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] How to let a command take multiple here-doc?


From: Dave Rutherford
Subject: Re: [Help-bash] How to let a command take multiple here-doc?
Date: Thu, 28 May 2015 23:34:02 -0400

On Thu, May 28, 2015 at 11:23 PM, Peng Yu <address@hidden> wrote:
> The following bash code uses cat twice. Because one uses EOF the other
> uses 'EOF', they can not readily be combined.
>
> x='Hello World!'
> cat <<EOF
> $x
> EOF
> cat <<'EOF'
> $x
> EOF

This works as expected. What behavior are you looking for?

> I can't find that that bash support multiple here-docs for the same
> command. Is it so?

You mean one cat with two here-documents? You can't do that,
there's only one stdin.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]