Sujet : Re: Using << and an output pipe together in shell (bash)
De : gazelle (at) *nospam* shell.xmission.com (Kenny McCormack)
Groupes : comp.unix.shellDate : 01. Nov 2024, 10:01:15
Autres entêtes
Organisation : The official candy of the new Millennium
Message-ID : <vg25cr$3uc49$1@news.xmission.com>
References : 1 2 3 4
User-Agent : trn 4.0-test77 (Sep 1, 2010)
In article <
vg18jc$2tv5s$1@dont-email.me>,
Janis Papanagnou <janis_papanagnou+
ng@hotmail.com> wrote:
...
Unless you put the 'nl' at the "right place"; you can write your
example below as
>
$ nl << EOF |
test
this
EOF
nl
>
so the backslash is not "necessary". - As you say, the '|' needs no
[spurious] continuation escape character if you have it at the end
of a command. - After the lines that define the here-doc (for 'nl's
redirection) the pipe command gets continued on the subsequent line,
which is the line after the "EOF".
Yes, that works, too. Thanks.
Somewhat surprisingly (to me, anyway), I think I actually prefer to stick
with; > >(cmd ...)
That has a certain beauty to it.
-- Reading any post by Fred Hodgin, you're always faced with the choice of: lunatic, moron, or troll.I always try to be generous and give benefit of the doubt, by assuming troll.