From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id 7901C283A5 for ; Fri, 15 Mar 2024 09:42:47 +0100 (CET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1710492167; b=UGa4x90hSwJ4Zz5lOSIGiuQNIQ3iRUXOoPkXDycHigOvjPWqgxPOTrvCN+oXP713rSQia8RSwu Ka1/upxCy22oq8qGO7JvnsGg0CI/LKWO+mwh4TJ/zBDA/FfouoNtNfr8jeAWKnC8Bkb97gsguO yqMj9aUgQUUu8x2xgyyfT4a66/WNQiBJ0yKrFlqviI/+arJSDvjHAoPct7af82BliL/d5MsKvc zjoV7O9eIT0rEWe7VQm9nJsIFawsmIGffU8mDHiJVg0KDgUXCAghB84vlMiz5I97a94G1mS8xY M8hOGilEWRQkhvO5NnmiWqQ5xbJQQs2g9nSPqdzVzegtSQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (relay2-d.mail.gandi.net) smtp.remote-ip=217.70.183.194; dmarc=none header.from=chazelas.org; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1710492167; bh=Z5cshoZt1pCDjFH1S8jXzAqtzI1YOHqj656RqywVS0w=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:DKIM-Signature; b=epGsHPiLDrWsmeu32QD0XzbHSufsytcUOiqQGDHdlTu4BcLNYhx/uqc9ba3vtMQe+vYNCfM0DM Dvr/VQ3CzIuYMpXtTHhte6CGf0A6QM7DqZWS70yHp8cGtPmvxf/pa+Ac0ngj9sJFDj5WcODLse fQbMcznUwpSDtU5rNuTRZwt4GapvhstnFzMcrVn8cCxcaXMTEBZdlRDm91Ln0bZ8j+JvUP51O/ WhJAeY0+zpoCoe9B+JP5JfP/bvlAfPwlfOWCXUpCpBGuTgQBy5PR6bON20UZynLjptGbJ/Epte hfK3jD6MWbXXL2VwTHorjGLch/D0/5ch9W7mqmu5ptScMw==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=rKfS6uNcnqZXYAmHLwYDlfoLm+F0JWnvsLMom+ZhIa8=; b=juTyGigc3KbcawbQEAQ6j37rVH 1/kguyC1lvBL6XjJlt+aRaEiSpogCNPYLOh25pTE9BfisfD8eot1I/6sGAtMCVQllGTFvjcOHuZkh 8JKfpf+3H8m2cm55Ecq+HyMoEzWQyFXDePidltDI77t9dt1ON8ooeiGgQ8NhBfmdHIdHk0n2QL1M5 YiAt8VoRLDNMb3L4zLTXCDyGTfs+M7dFRA5/g4jqnz0r8jVt183IPNGrI0ZsACyKkE7r0ErNmhnWi aiIo9n8nW7h0RMAOlbyACKYONkyyU1YbXAw1Wlxe0eTr9dtz/ONzNNyeRVEBAycXvrSLD2+p0dgD0 GM5o9RmQ==; Received: by zero.zsh.org with local id 1rl39K-000MNX-VS; Fri, 15 Mar 2024 08:42:46 +0000 Authentication-Results: zsh.org; iprev=pass (relay2-d.mail.gandi.net) smtp.remote-ip=217.70.183.194; dmarc=none header.from=chazelas.org; arc=none Received: from relay2-d.mail.gandi.net ([217.70.183.194]:50043) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1rl392-000M5P-L9; Fri, 15 Mar 2024 08:42:29 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 3991240011; Fri, 15 Mar 2024 08:42:26 +0000 (UTC) Date: Fri, 15 Mar 2024 08:42:26 +0000 From: Stephane Chazelas To: Oliver Kiddle Cc: Bart Schaefer , zsh-workers@zsh.org Subject: Re: [PATCH?] Nofork and removing newlines Message-ID: <20240315084226.rsgcm35fbqld3t2p@chazelas.org> Mail-Followup-To: Oliver Kiddle , Bart Schaefer , zsh-workers@zsh.org References: <90726-1709936102.086878@xlWC.oGpX.V4Q4> <34739-1710017038.959920@XhYc.enDL.DTxr> <25344-1710285573.990297@5-7t._0Mp.XRXG> <31438-1710454547.652877@WxhA.vkY6.ljF0> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <31438-1710454547.652877@WxhA.vkY6.ljF0> X-GND-Sasl: stephane@chazelas.org X-Seq: 52760 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: I don't know if that could be done and it's probably too late anyway, but I thought I might throw in the idea anyway. What about, instead of adding ksh93's ${ cmd;} and mksh's ${|cmd} (in slightly diverging ways), we added just a | expansion flag whereby: ${(||)any zsh code} would expand to the output of the code without the fork and without the newline trimming. ${(|var|)any zsh code} would expand to the value of var as set by the zsh code Some advantages: - the flags can be cumulated as usual. So you can have ${(||.s[:])getconf PATH} to split the output of getconf PATH ("." to trim one newline, ".." to trim all) for example. - there's no extra rule as to how the expansion works and how it can be combined with others as it's the same syntax as other parameter expansions - as it's different syntax, it removes the potential surprises when ${ cmd;}, ${|cmd} behave differently than in ksh93/mksh/bash ============= Or (as a completely different idea), an alternative to mksh's ${|cmd} and ${|var|cmd} could be written ${REPLY