zsh-users
 help / color / mirror / code / Atom feed
From: Stephane Chazelas <stephane.chazelas@gmail.com>
To: Aryn Starr <whereislelouch@icloud.com>
Cc: zsh-users@zsh.org
Subject: Re: Capture stdout, stdin, and exit status in different variables without using temporary files
Date: Fri, 16 Aug 2019 08:22:09 +0100	[thread overview]
Message-ID: <20190816072209.yk6nko5dkaahekzd@chaz.gmail.com> (raw)
In-Reply-To: <D639E5A6-A28C-40EE-B0E6-27BED4C8CDDB__31117.9253900022$1565917892$gmane$org@icloud.com>

2019-08-15 20:22:38 +0430, Aryn Starr:
> Per http://mywiki.wooledge.org/BashFAQ/002, it seems this can not be done in bash. Is it possible in zsh?
> If not, is a named pipe advantageous to a temporary file?
> Is there a way to avoid disk IO (which will probably slow things down considerably)?

See

https://unix.stackexchange.com/questions/472585/read-write-to-the-same-file-descriptor-with-shell-redirection/473402#473402

(and
https://unix.stackexchange.com/questions/430161/redirect-stderr-and-stdout-to-different-variables-without-temporary-files
)

Redirecting to files doesn't necessarily mean disk I/O.

-- 
Stephane

       reply	other threads:[~2019-08-16  7:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <D639E5A6-A28C-40EE-B0E6-27BED4C8CDDB__31117.9253900022$1565917892$gmane$org@icloud.com>
2019-08-16  7:22 ` Stephane Chazelas [this message]
2019-08-16 10:05 ` Stephane Chazelas
2019-08-16 10:45   ` Aryn Starr
2019-08-16 13:01     ` TJ Luoma
2019-08-16 13:16       ` Roman Perepelitsa
2019-08-16 17:08         ` TJ Luoma
2019-08-15 15:52 Aryn Starr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190816072209.yk6nko5dkaahekzd@chaz.gmail.com \
    --to=stephane.chazelas@gmail.com \
    --cc=whereislelouch@icloud.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).