Dixi quod…

>I think coprocesses are pretty usable for this in almost all cases
>(I did have one where they weren’t, but you can still often background
>a part, then play with fd redirection).

Another thing that may help you, if it’s absolutely needed:

Before we had ${PIPESTATUS[*]} I wrote things like this:

foo | (bar; echo $? >bar.rv) | baz

Similarily, you can do tricks with high file descriptors.

x=$( (echo foo | (tr a-z A-Z >&4) | (echo bla >&5)) 4>&1) 5>&1
echo x=$x

This gives:

bla
x=FOO

Both not as efficient as direct variable assignment, but…

And let's not forget using…
        while …; do …; done <foo
… instead of…
        cat foo | while …; do …; done
… (which is cat abuse anyway).

Often, some not-so-basic or more modern scripting approaches
can eliminate the need for a construct like you were asking for.

Good luck,
//mirabilos
-- 
> emacs als auch vi zum Kotzen finde (joe rules) und pine für den einzig
> bedienbaren textmode-mailclient halte (und ich hab sie alle ausprobiert). ;)
Hallooooo, ich bin der Holger ("Hallo Holger!"), und ich bin ebenfalls
... pine-User, und das auch noch gewohnheitsmäßig ("Oooooooohhh").  [aus dasr]

Reply via email to