From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20803 invoked by alias); 10 Mar 2017 23:32:15 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 22556 Received: (qmail 1495 invoked from network); 10 Mar 2017 23:32:15 -0000 X-Qmail-Scanner-Diagnostics: from mail-vk0-f54.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.213.54):SA:0(-0.0/5.0):. Processed in 1.058795 secs); 10 Mar 2017 23:32:15 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_PASS, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: ndorfman@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.213.54 as permitted sender) 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== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=4z56HbkBjSzAAUR8qfsGSsFVcI0QY3fSlQDXSg6W43w=; b=O48nT5zJodFPheBvpPoawT84DuItfyJp6unywl+laqXClk9QirfJkB/wS7B8gvHQGC WX4ZqHQd91ig7yGaY42rFzVIOLBVJKvcZnix/sZNCYEAKRMJ1kvBg3NthOtvm2HmMdws ZjIfcgfJ3R+CNN2qUKTq9qwUud3/8f8+MHZWohnPoeXsZe7MPy8qQBntPBJ+dnAio666 5zAu9eddg3654q5sONMY79c21dKgM/y4+QbWsVlusKbVRKlG06aKL0iaTaC4K8E/atfP WsOqM15Gy9uPH9Dh7Jouug4bTXywrZd97848IqbGFn8uoYm9dzQtEm4v2zw789GoxBvp kswQ== X-Gm-Message-State: AFeK/H0EP0J0aBFBdULpqaUHxUpCojNZVbBMbUAAjeC4IAubpVW8v9rLGsQviL0Xr3rLhtbH/PVKU03yKiCsKA== X-Received: by 10.31.212.2 with SMTP id l2mr168504vkg.153.1489188727800; Fri, 10 Mar 2017 15:32:07 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <170310105112.ZM843@torch.brasslantern.com> References: <170309180417.ZM14034__34042.4779606566$1489111700$gmane$org@torch.brasslantern.com> <20170310172219.GA4206@chaz.gmail.com> <170310105112.ZM843@torch.brasslantern.com> From: Nathan Dorfman Date: Fri, 10 Mar 2017 16:32:07 -0700 Message-ID: Subject: Re: Redirect a specific file descriptor to a pipe? To: Bart Schaefer Cc: zsh-users@zsh.org Content-Type: text/plain; charset=UTF-8 On Fri, Mar 10, 2017 at 11:51 AM, Bart Schaefer 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.