zsh-workers
 help / color / mirror / code / Atom feed
* Re: Redirect a specific file descriptor to a pipe?
       [not found]         ` <170310182430.ZM17517__8964.51098747111$1489199135$gmane$org@torch.brasslantern.com>
@ 2017-03-13 17:26           ` Stephane Chazelas
  0 siblings, 0 replies; only message in thread
From: Stephane Chazelas @ 2017-03-13 17:26 UTC (permalink / raw)
  To: zsh-workers

2017-03-10 18:24:30 -0800, Bart Schaefer:
> On Mar 10,  4:32pm, Nathan Dorfman wrote:
> }
> } I still think it might be useful to be able to pipe any fd, not just
> } stdout, but I don't know if I can contrive a great example.
> 
> It depends on what your intentions are.  The definition of a pipeline
> in shell syntax is that the standard output of the left side connects
> to the standard input of the right side.  So if you want to use a pipe,
> you have to make the right thing *be* stdout, regardless of which other
> descriptor it might have started out to be.
[...]

For information, the rc shell allows piping any fd, not just
stdout on the left command to stdin of the right command.

cmd1 |[3=4] cmd2

Would make a pipe in between fd 3 of cmd1 and fd 4 of cmd2


yash has a pipeline redirection operator (shaped like ksh's
process substitution operator).

cmd1 3>(cmd2)

Runs cmd1 with fd 3 to a pipe to fd 0 of cmd2.

yash doesn't wait for cmd2 there though.

-- 
Stephane


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-03-13 17:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CADgEyUsOZZZhiJM5JQrdHORt-ehoLJtYmwW8po4=LViuydMFiw@mail.gmail.com>
     [not found] ` <170309180417.ZM14034__34042.4779606566$1489111700$gmane$org@torch.brasslantern.com>
     [not found]   ` <20170310172219.GA4206@chaz.gmail.com>
     [not found]     ` <170310105112.ZM843@torch.brasslantern.com>
     [not found]       ` <CADgEyUu9Ds5kNMA-uLa0Fo4KHw6AKfC4r3dDqBJ--4rcPU9Lvw@mail.gmail.com>
     [not found]         ` <170310182430.ZM17517__8964.51098747111$1489199135$gmane$org@torch.brasslantern.com>
2017-03-13 17:26           ` Redirect a specific file descriptor to a pipe? Stephane Chazelas

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).