From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 7625ec5d for ; Fri, 16 Aug 2019 07:22:59 +0000 (UTC) Received: (qmail 27413 invoked by alias); 16 Aug 2019 07:22:49 -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: List-Unsubscribe: X-Seq: 24148 Received: (qmail 10614 invoked by uid 1010); 16 Aug 2019 07:22:49 -0000 X-Qmail-Scanner-Diagnostics: from mail-wr1-f46.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25538. spamassassin: 3.4.2. Clear:RC:0(209.85.221.46):SA:0(-2.0/5.0):. Processed in 1.793396 secs); 16 Aug 2019 07:22:49 -0000 X-Envelope-From: stephane.chazelas@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.221.46 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=b+Is2V4wSNJCiXqcDGND71Csv2dR9XjwnH/OgtkPB3w=; b=Nr4HIs9rWRKvZDBlbxqO1OjeCRSKgak3IGOZ6UN54iqYEa5aFYuKhKAyrc2EKAigu3 qEy834+SsMD3zkq8zbdaL63jVsOpR3z2ujocbi73ZC3CdnUq0bYhVTeJvRSAblwItrSt Twlbnq2Y/+jPkoaGt7HX/a/NE95OIit5LZt1oBLK0rzWw9wo0UeSf2Cb3AFlrkIXsJPL Txl3sQ3afZziOTFSlF+0waQCn9hq5Q739/gNKZpFrIxdrs9tRx5PIlCPXPIfXTU3D8hi RS9G5ER/XAsq8xxRClGk+S1nYlyioulHNRWu4tPVd+uzH7IoudshNHIuM1cniY/yCXkz Ai5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=b+Is2V4wSNJCiXqcDGND71Csv2dR9XjwnH/OgtkPB3w=; b=mgW0KCu6noAiC1Fqz00ETe/EcOPrssC1N9+JJKN0Rbixorh2yqaCKHxp/g54n4a8Pg Ve0toT2jCEBHjRlQJtxLuxGXshIW0AIHH9qZkLH6G55NGQKwhwiQDtu6hGcGhw0wuWnd ZCt3XSewIiOZpi7ZA1vaBMEAZnIRS2P3dsZa4X9B+kNdGnXiobEfGhKUF34Avhn/K9wE 8N2E/ZNnZIEv5YolmAE2iC8MuwGxd82Ld9+WSZBFw70tqaK6oH/CxWw69dH8xaHT6QF7 HaEn9BHoDbC9zuotd+vrNcIBK4ZmKm7BgxF9VdEBttvrGJe801aGtJ0BtGHwgFbwB93Y QcOA== X-Gm-Message-State: APjAAAWXb1OnhZ0XpBnJ/xjQloH0/qkmB0kjFBy3CT3ezbj7Bje5jTXg nRYoQqMnVYhXDwWj/DmcEjw= X-Google-Smtp-Source: APXvYqyqzgX8SagxmIfm/CrWtvQEDF/RhabRwYStaWBlmg5s8J6oKE8iPDEiCsHRZmZ842Jp0TXE8g== X-Received: by 2002:adf:9b9d:: with SMTP id d29mr8842568wrc.132.1565940132120; Fri, 16 Aug 2019 00:22:12 -0700 (PDT) Date: Fri, 16 Aug 2019 08:22:09 +0100 From: Stephane Chazelas To: Aryn Starr Cc: zsh-users@zsh.org Subject: Re: Capture stdout, stdin, and exit status in different variables without using temporary files Message-ID: <20190816072209.yk6nko5dkaahekzd@chaz.gmail.com> Mail-Followup-To: Aryn Starr , zsh-users@zsh.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20171215 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