Zsh Mailing List Archive
Messages sorted by:
Re: Redirect a specific file descriptor to a pipe?
- X-seq: zsh-workers 40841
- From: Stephane Chazelas <stephane.chazelas@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: Redirect a specific file descriptor to a pipe?
- Date: Mon, 13 Mar 2017 17:26:56 +0000
- In-reply-to: <170310182430.ZM17517__8964.email@example.com>
- List-help: <mailto:firstname.lastname@example.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:email@example.com>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CADgEyUsOZZZhiJM5JQrdHORt-ehoLJtYmwW8po4=LViuydMFiw@mail.gmail.com> <170309180417.ZM14034__34042.firstname.lastname@example.org> <20170310172219.GA4206@chaz.gmail.com> <170310105112.ZM843@torch.brasslantern.com> <CADgEyUu9Ds5kNMA-uLa0Fo4KHw6AKfC4r3dDqBJ--4rcPU9Lvw@mail.gmail.com> <170310182430.ZM17517__8964.email@example.com>
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).
Runs cmd1 with fd 3 to a pipe to fd 0 of cmd2.
yash doesn't wait for cmd2 there though.
Messages sorted by: