From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 22179 invoked from network); 25 Jan 2021 15:15:54 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 25 Jan 2021 15:15:54 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1611587754; b=GYLN6a6oZ6LYDuAPbvj0eevHgeF3OfWiE3OcgQfFSLgBCdp5dAnVOpsI0S5cB05fbHay7CeUEs OXebOGYf6NM27twd3DUbFgZWmG+kyEH6greO/I313NVpNCQ4IpR5y0nC7w5dRa5EhKt6myoti0 2r/xsFKtOaXurWrF0jhTpE6DIMpBGhB9ed5j5ULusCwiEDdpzYnBVOcSZ+RkL0ONlZPTh53FmE 2hI9bZYFsT+UaV/FzJ9mWsplAqnpdQaDcTB8v3W70G9E0PEw69HPprYKr7kXCzQ50AcO56uikq XzlQXTqw/lAWVBCougI4gLHoxmFbwFRRiLtCFjklpnejKA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mta02.eastlink.ca) smtp.remote-ip=24.224.136.13; dmarc=none header.from=eastlink.ca; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1611587754; bh=1nTvnIapQo6LFO+Hyq5uyChlth1qY/mN3+XGzM5AQPQ=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:To:Subject:DKIM-Signature; b=gzzXSYq3p7FMgBbJi2HfVtz0v36jUUhh0bYBekMmH+Fpsz0xQJkCAny3CQcsfzwMXdIkwoIoaP X1heeA2OVQdCZRwnNLNfAmEFjFo3YMz9lyCspsO79r0gfXJp5ozD2D1HTSvq94hYZ2S0GCzQy0 LRcWbzO3eajY1D54DzT52Ome/y1ju091NhXYO6Nmny803BUZ1apncg2+LpsRBpo6Ck+1xIvDIB S3p2xMLFbyUlly0Ua73Ez1B6o4xXXxbq76Wj+lzYFKW0Vd0Cv2aNeSCTH4uVUMRqbBVFWsHtXj cm0fdOoeKQ77D1SB2YIxEqPy22dWA2zoa7A1obI9TOrR7g==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-transfer-encoding: Content-type:In-reply-to:MIME-version:Date:Message-id:From:References:To: Subject:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=HoWAis/Ao+LeTWTRbCNyGUI13D2V2qElQiToqVRln4Q=; b=uoAm5C5nASNG4JKKzXoDazXCqL Cq2/dgyxo+j/Q01RXfi0Xd96xpBFDO0U0DNivn8xh0njKG+d8ufn5Ws36wQT8HZnLtKdAez3fFkSY 9+c5oDpzR7BWFW3H/00fl0uuT5/1ykponKB4MfCtyLKp6dSWtv/ZLzFX+fhu8C3Mgd0QtVw9ZXtsm XM8K7tZsu1hsNgRQrYXDnx00uQhHat+khrD4+RNcO4nrdpz/UzcmMUDWXN48vzBPE3Nih2MrpdVcX pz8qLknt9X2zIUExyGf0Z1QJ3ejLSp2hn0GoC0MheuHXPINYMGDta19xWYdrNFfy0hEXjtlWrTMNu YqJ/mesw==; Received: from authenticated user by zero.zsh.org with local id 1l43as-000ISc-8l; Mon, 25 Jan 2021 15:15:54 +0000 Authentication-Results: zsh.org; iprev=pass (mta02.eastlink.ca) smtp.remote-ip=24.224.136.13; dmarc=none header.from=eastlink.ca; arc=none Received: from mta02.eastlink.ca ([24.224.136.13]:34328) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) id 1l43aR-000I4y-6F; Mon, 25 Jan 2021 15:15:28 +0000 Received: from csp02.eastlink.ca ([71.7.199.167]) by mta02.eastlink.ca (Oracle Communications Messaging Server 8.0.2.2.20180531 64bit (built May 31 2018)) with ESMTPS id <0QNH009V3WAF1VU0@mta02.eastlink.ca> for zsh-users@zsh.org; Mon, 25 Jan 2021 11:15:25 -0400 (AST) Received: from [192.168.0.2] ([24.207.90.194]) by Eastlink with ESMTP id 43aOlUfDpDl3l43aPlzu5O; Mon, 25 Jan 2021 11:15:25 -0400 X-Authority-Analysis: v=2.4 cv=HJEGqqhv c=1 sm=1 tr=0 ts=600ee08d a=zv49KfEsxEDzuN5AGO7r0Q==:117 a=zv49KfEsxEDzuN5AGO7r0Q==:17 a=IkcTkHD0fZMA:10 a=gw3VopixHoosL1CPZpUA:9 a=QEXdDO2ut3YA:10 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdefgdejvdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfgtefuvffnkffpmfdpqfgfvfenuceurghilhhouhhtmecufedttdenucenucfjughrpefuvfhfhffkffgfgggjtgfgsehtkeertddtfeejnecuhfhrohhmpeftrgihucetnhgurhgvfihsuceorhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrqeenucggtffrrghtthgvrhhnpeekvdeuuefffefhvdeuieetffdvtddvjeegueejkeeiudehieetieehgeetvdfhfeenucfkphepvdegrddvtdejrdeltddrudelgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvgedrvddtjedrledtrdduleegpdhhvghloheplgduledvrdduieekrddtrddvngdpmhgrihhlfhhrohhmpehrrgihrghnughrvgifshesvggrshhtlhhinhhkrdgtrgdprhgtphhtthhopeiishhhqdhushgvrhhsseiishhhrdhorhhgpdhgvghtqdgkihhprfgrshhsfigupehtrhhuvg X-Vade-Score: 0 X-Vade-State: 0 X-EL-IP-NOAUTH: 24.207.90.194 Subject: Re: capture stderr in command substitution To: zsh-users@zsh.org References: <1eb9835c-3911-d4ea-6456-d9ad52ceffea@eastlink.ca> <20210124194750.dtyacd5emjauwxec@sym.noone.org> From: Ray Andrews Message-id: <38504cf6-a3c0-eb22-8a0b-6410d27ebbbc@eastlink.ca> Date: Mon, 25 Jan 2021 07:15:24 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-version: 1.0 In-reply-to: <20210124194750.dtyacd5emjauwxec@sym.noone.org> Content-type: text/plain; charset=utf-8; format=flowed Content-transfer-encoding: 8bit Content-language: en-US X-Seq: 26414 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: On 2021-01-24 11:47 a.m., Axel Beckert wrote: > > $ var=$(command 2>&1) > Thanks, superficial testing shows it working fine.  I finally sorta understand it too, you can read it as 'output #2 goes back to output #1. var=$(cmd>&2) That seems not to work but I'm in no mood to look into it so long as Axel's performs. { var=$(cmd 2>&1 >&3 3>&-); } 3>&1 ... is not something that the eye's of a mortal should ever look upon ;-) BTW (not worth starting a thread on this) how do you keep a command out of history? I usta know this but can't remember and I've written it down somewhere but can't find it :( I take a year off from coding anything and forget 101% of what I had learned.