Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Redirect a specific file descriptor to a pipe?
- X-seq: zsh-users 22556
- From: Nathan Dorfman <ndorfman@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Redirect a specific file descriptor to a pipe?
- Date: Fri, 10 Mar 2017 16:32:07 -0700
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=4z56HbkBjSzAAUR8qfsGSsFVcI0QY3fSlQDXSg6W43w=; b=plWSZn3ki1iahEzqNHaYveWTJIJo1fpUl15+cIu/sSIuj/Lu9FOXmxbAdjsolCGO3j oiIpPts4y8K05WEkLKU+sunvmh1M9imiwvoAHRurIR8Bt7mOYL0ohrAuRsDz7oFaoYcV u2dVW05zPQednmwN2HivqMF5FWQIPu3LVxSgOsIaTaESzGo7X7hN38Q6fp0v1rGTXmXt hS/blpI3x/PiK0ct0lyws0XoHrKN/WZlB2mo1zL6GuZZToQDHLz6oPAUlgMRVT+o3U7q 121iyXFXQhlM7/h/0abfloehsAO0P6lcfdLX57uAUUo+pnhtz21XRBrjpEfOUdw5bSDf 8MYQ==
- In-reply-to: <170310105112.ZM843@torch.brasslantern.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CADgEyUsOZZZhiJM5JQrdHORt-ehoLJtYmwW8po4=LViuydMFiw@mail.gmail.com> <170309180417.ZM14034__34042.4779606566$1489111700$gmane$org@torch.brasslantern.com> <20170310172219.GA4206@chaz.gmail.com> <170310105112.ZM843@torch.brasslantern.com>
On Fri, Mar 10, 2017 at 11:51 AM, Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
> } In zsh, to avoid the multios effect, you can do:
> }
> } {strace -o /dev/fd/3 ./a.out 3>&1 > out.log 2> err.log} | less
> }
> } or disable multios (set +o multios).
>
> With multios and without the braces, out.log gets the a.out output
> and less gets both the strace output and the a.out output, which is
> actually what I meant to do (but might not be exactly what Nathan
> wanted, in retrospect). Thanks for the correction.
Thanks guys, this does actually answer my question, and makes sense
now that I think about.
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. Perhaps we
can't redirect stdout because it's a curses program that needs direct
terminal access, but we want to do something like this:
strace -o /dev/fd/3 mutt 3>XXX
Where instead of XXX, we want to send fd 3 to |xz or |ssh?
Feel free to ignore me if you think I'm going off the deep end :)
-nd.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author