Sysop: | Amessyroom |
---|---|
Location: | Fayetteville, NC |
Users: | 40 |
Nodes: | 6 (2 / 4) |
Uptime: | 21:18:10 |
Calls: | 291 |
Files: | 910 |
Messages: | 76,666 |
Posted today: | 1 |
P.S. To answer one question, "coproc" *is* a shell keyword in bash:
[...]
I think you will find that |& is also a keyword (in ksh),
although I could
not get "type" (or anything similar) to confirm that suspicion.
In article <vff8qc$31tk9$1@dont-email.me>,
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
...
For multiple co-processes you may be right. (I certainly differ
given how Bash implemented it, with all the question that arise.)
And I already said: I don't think it makes much sense to discuss
subjective valuations.
Our opinions are all we have. I can't see how that can be "off topic".
[...]
I really do think that there's no significant difference in verbosity
between the two implementations (certainly in the simple case).
The ksh
way of handling multiples looks kludgey to me (you may think otherwise, of course). It certainly looks to me that the bash way was designed (no doubt benefiting from ksh having paved the way), whereas the ksh way "just grew".
[...]
what is the 'coproc' actually (beyond a "reserved word")?
Then, depending on that; is the redirection part
of a special case here? And that's the reason why it's listed
explicitly? Note redirection is an orthogonal concept! Here too?
The
access to the FDs is implicitly defined by 'COPROC[0]' for "output" to
the process and 'COPROC[1]' for input to the process; is this coherent
with 'stdin'(0) and 'stdout'(1); this at least irritates me, it's not as obvious as it could be.
Or you want Ksh to choose the FDs, then use variables (as you can
also generally do with non-coprocess related redirections) like
exec {IN}<&p {OUT}>&p
(with arbitrary variable names, here IN and OUT chosen, which looks
more sophisticated to me than 'COPROC[0]' and 'COPROC[1]').
This post should also explain why I think that your valuation that
in Ksh the feature "just grew" is not justified. Beyond the '|&' vs.
'coproc' reserved word; consistency with '|' and '&', redirection,
assigned FDs (if desired), consistent 'p' as read/print option and
as FD, all fits and allows for readable straightforward code in Ksh
that also doesn't leave me with questions.
BTW, co-processes were designed into the shell with Ksh88 already;
not much to "just grow" (as you insinuated). ;-)