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, 00:05:20
Autres entêtes
Organisation : The official candy of the new Millennium
Message-ID : <vg12fg$3tq77$1@news.xmission.com>
References : 1 2
User-Agent : trn 4.0-test77 (Sep 1, 2010)
In article <
87r07v99wd.fsf@bsb.me.uk>, Ben Bacarisse <
ben@bsb.me.uk> wrote:
...
I think you need "| \" at the end of this line. At least that's what I
usually do and it seems to work.
It is not generally necessary to put a backslash at the end of a line that
ends with | (in shell script).
But it *is* necessary in this special case! So, you get the prize.
Note that this solves it as far as getting bash to be happy with it is
concerned. When I get a chance, I need to see about how VIM feels about it.
Here's test case:
$ nl << EOF | nl
test
this
EOF
1 1 test
2 2 this
$ nl << EOF |
nl
test
this
EOF
-bash5: syntax error: unexpected end of file
Status: 2
$ nl << EOF | \
nl
test
this
EOF
1 1 test
2 2 this
$
-- It's possible that leasing office space to a Starbucks is a greater liabilityin today's GOP than is hitting your mother on the head with a hammer.