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: Chet Ramey
Subject: Re: [Help-bash] How to let a command take multiple here-doc?
Date: Mon, 01 Jun 2015 08:55:47 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

On 5/31/15 8:38 PM, Peng Yu wrote:

> Also, the above link shows the following example. I am not sure why it
> is usefully to intertwine the heredocs of the two separate commands.
> Does anybody know?
> 
> cat <<eof1; cat <<eof2
> Hi,
> eof1
> Helene.
> eof2

Remember that the shell always reads at least one complete line before
parsing it into commands.  The list command created from the command line
above needs two here-documents to complete; they are read from the standard
input one after the other.  There's nothing unusual about it.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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