On Wed, 2004-08-11 at 21:29, Paul Jarc wrote:
> Enrique Perez-Terron <enrio@online.no> wrote:
> > commands_1 | exec | commands_2
>
> You can do that now, but it's spelled differently:
> exec < <(commands_1) > >(commands_2)
That is good. However, the docs says the process substitution is
supported only on systems that support named pipes or the /dev/fd method
of naming open files.
The suggested "command | exec" and "exec | command" should be
supportable whenever pipes are supported.
Perhaps the closest we get to this with the current bash is
commands_1 | {
the rest of the shell script
} | commands_2
but if commands_1 and commands_2 are small textually, and the rest of
the script is long, the
command_1 | exec | command_2
variant is more readable. Otherwise, only constructs like
cd /proc/self; pid=$(/bin/pwd); echo ${pid##*/}
would distinguish the two.
-Enrique
-Enrique