bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sub shell mit pipes


From: Enrique Perez-Terron
Subject: Re: Sub shell mit pipes
Date: Wed, 11 Aug 2004 22:27:01 +0200

On Wed, 2004-08-11 at 21:29, Paul Jarc wrote:
> Enrique Perez-Terron <address@hidden> 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]