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 5e6b9d71 for ; Fri, 16 Aug 2019 13:03:02 +0000 (UTC) Received: (qmail 27424 invoked by alias); 16 Aug 2019 13:02:54 -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: 24151 Received: (qmail 81 invoked by uid 1010); 16 Aug 2019 13:02:54 -0000 X-Qmail-Scanner-Diagnostics: from mail-wr1-f47.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.47):SA:0(-2.0/5.0):. Processed in 3.467347 secs); 16 Aug 2019 13:02:54 -0000 X-Envelope-From: luomat@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.47 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=U6+FNnItHIidcepn+Mbr4Kdfn2+RaDsHAbmNroI4r8Q=; b=PIiWy7NniDa41hp43QV3e0Fg2C04/w6oVm7YSWJWHCiDUEfW5rUv2GG1dAuc8Owwrw Q85bEHBemJ71GR9v5RFWg6w9dx2ShXEDJ/YHSU2GZKwvEJ0jjxTMHkLnhRhmu9PzmxiR ag3xUfWcH+7LC2x4OlWCKYshnrCAQ+yi6XKOhs1foHE8fg2DlDRXKKHMD2BUHWd+hnGx WTeAj7ePLX9b8H60nHdfRfnNJ398UWbGsRrkDCivCXjc1zEh2k+gSFO3i9va6R4Hc058 GaNf9/3APyQFqAcUw7JKwzS8IwAjTgonNrkI363xUebcHmVS4iexAr+2iu2gm5eDdz3d hTtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=U6+FNnItHIidcepn+Mbr4Kdfn2+RaDsHAbmNroI4r8Q=; b=OOaTCxzM87f1NZTfx6KFAwTtbIEIcxrmkjnZclOXEmDIx8LeDD4GKTnetZPrDzPelu O5kzPyq/PLBUsdeuGPbVo0Kns+mhhkP1rW019PERjivmvWgdxVtXAr8s5nTWihtbM5l5 c9NYxmxElyJzvPOOXygIdROFQIHUWPqef/QlqZ9wWWqh8Y2ODiBsaa5Bp3MxMuReLB6v mUhLCiiz8MSy+q0s8v5Lpcj+ARsnZ336JVJ/yc+mv0y8HbYcql0Xitc3P2cyt5uI0dQs UvpZQhl6MxXN8j2FO5IvngC6kkHtubn6E0HFA6tfppp19JMCg7xajg6en6VOPe0c4O7M GMXg== X-Gm-Message-State: APjAAAXxV1hR1JWFhBMTrXvjeYnSFcKxL0QPQN1MjjKYfIncsgh7SOFB qbgH7jQx8MW3OtmrQaeYUzuQ4tuO7dEtyu88y7vOwEX1phY= X-Google-Smtp-Source: APXvYqyArX/og/W52yd8tl6Fki34+v+7FmYtIBu17/GCaPL7brOczIWCcTpu5mGAXZcjKGxqmYRlaMpNWWGsxVq0+/8= X-Received: by 2002:adf:e94e:: with SMTP id m14mr11441961wrn.230.1565960536610; Fri, 16 Aug 2019 06:02:16 -0700 (PDT) MIME-Version: 1.0 References: <20190816100501.nsvfbdwwnoaihlhe@chaz.gmail.com> <70382019-1857-4452-85FC-F038D8BBE206@icloud.com> In-Reply-To: <70382019-1857-4452-85FC-F038D8BBE206@icloud.com> From: TJ Luoma Date: Fri, 16 Aug 2019 09:01:40 -0400 Message-ID: Subject: Re: Capture stdout, stdin, and exit status in different variables without using temporary files To: Aryn Starr Cc: Zsh MailingList Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I have used this, which I am sure someone on the zsh probably gave me: (){ STDOUT=3D$( your-command-here 2> $1) STDERR=3D$(<$1);} =3D(:) Using an actual example=E2=80=A6 I know that `find -x / -maxdepth 4 -print` will provide both kinds of output, so if I use that here: (){ STDOUT=3D$( find -x / -maxdepth 4 -print 2> $1) STDERR=3D$(<$1);} =3D(:= ) then I can use $STDOUT and $STDERR to get the respective outputs. I hope that helps! Tj -- TJ Luoma TJ @ MacStories Personal Website: luo.ma (aka RhymesWithDiploma.com) Twitter: @tjluoma