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 7923528E76 for ; Tue, 27 Feb 2024 21:54:08 +0100 (CET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1709067248; b=fb4DmVoo28KzpxBdmX+47T6RQ7ueztoWljbV2izhyQqhREP4OqQuN57PQQzhdzyAKoLoB1HjM3 DHGBW+woviQREwhVOOmiJjCKboWxJL28+AdATMnRwItViXbtsGfaeHL/z5q2n9bGhP2zoxjn44 pHIuBLGm/NwFRSNM0HqAtOGktu8BhicklzMW0/0p6i3xituyfVwQw0HtSUl1QI3cF3EWKD0mjf JkmiwfarOfCo+5cRQEZY6nLAXAZ5lVlfxTLx3Jp/3hja3THnLr/hsqJMpcOQmRxMtOop29goyY /oDquV8qTiblrcslFWGnUM2qazrFRLXolyA2IwSQqZbLnw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f46.google.com) smtp.remote-ip=209.85.218.46; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1709067248; bh=33slqPYUEPbxtMqaYwW3R3V+98EDDOTZS0mEN58rh6Q=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:To:Subject:Message-ID: Date:From:MIME-Version:DKIM-Signature:DKIM-Signature; b=FIswO7RNR1LFnzkZ1jLelMfvpHErtqgRkXTln/Ht14Srn27jtOhfYphFZj7IHcwL1LplU+P8Dc bRFRAy6r+nHM5Lb3NtthnLSgANkqETAydnFDJq24CxfUd+4vyPPiCPiUadbIIfy4htlcwu3Q6E 7e7aomiwZN3Ym6ieYgOENO++dhWJGvKR8P0xhsiY7OAEaz4QwejAsewFvyCmfirnGvO3igj1Ff 0Yxe8hFYa5TDV+S5/yufyaiTkzZvkdFK0yIotpqdLMLe8zpBVUfnsBZ8YVCdyhdB8Mxf6oe8SW DsoFcrnbP6F6ZapUQbGEFtGitFaPMaTcI5qt3pmyar/nZA==; 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:Content-Transfer-Encoding: Content-Type:To:Subject:Message-ID:Date:From:MIME-Version:Reply-To:Cc: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References; bh=L8hGqw4yPVnyHN9066nZ2uOoxuCSAyghFLo9jOKveHA=; b=VCKx9n3rfRj1gJiwL1j2Zs+NbB kDPg6E3rl5qq+sLHO3XvIqtXho/iEaqLvR8ropwfqhaBJqWpvM6GspRAfd2Z4thK60SvPsTUnmKS0 MX2BGLAOeKHwlRoT8lza5ukMXMpqLnzFQXrMePHIKafDOhRte/FUnjiTlIH6Zp05AVDhUi+qFfF9Z KDKRZmDrFNfugXZ9JRRknorUN9DHNhiHrm6JlYRxjmfn5Dz8NM4eiyPsXuZbUhAjyYwrayfShjdu+ 6j3qGBRdr3VwwlXUcyxH8z+bSGUq+yRNwrLUMLv6T5Yoni2gXCDtQ1ruTg748ymx67+U2byX0acBn maVi1dcQ==; Received: by zero.zsh.org with local id 1rf4Sm-0009qb-HU; Tue, 27 Feb 2024 20:54:08 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f46.google.com) smtp.remote-ip=209.85.218.46; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ej1-f46.google.com ([209.85.218.46]:52600) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1rf4SC-0009Vj-2t; Tue, 27 Feb 2024 20:53:33 +0000 Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-a3f5808b0dfso655317066b.1 for ; Tue, 27 Feb 2024 12:53:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20230601.gappssmtp.com; s=20230601; t=1709067211; x=1709672011; darn=zsh.org; h=content-transfer-encoding:to:subject:message-id:date:from :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=L8hGqw4yPVnyHN9066nZ2uOoxuCSAyghFLo9jOKveHA=; b=fnHZH1OEWM4U3X6tWNz0wh5Bs1N7TP5tpDIIDCnO31HgXArp4S+HtZin9P4jSCmxg4 3isFR2BHlUqaTMi+r/62gFcIqyO1UhB+xu4WPoN2rhPeq0vw8VVRibARjkVcUItBMdzc YYai1Ehz8b2LjcTxU1JnOY6ToIgcnZ9yOM5csJC3AwAE2iPcCvsdS/1yZhTcc6vMoIhD ePP6YOwCQxG4m3w1q3qe8AwoYGeJgcdQiek+Z3iZWQE3NrZKPOjwZss7HEIEPN43TZIB OPqEMjetlrRleLeDjlHtoboh5u0Yza/wnRhkb9CKctE36HfTwgTT4sxQIVb72OTKDVoR Bfcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709067211; x=1709672011; h=content-transfer-encoding:to:subject:message-id:date:from :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=L8hGqw4yPVnyHN9066nZ2uOoxuCSAyghFLo9jOKveHA=; b=mK+p8N1oETwK4k1bDSjNITYGKxnDksYy+JTorjD4iE3Zug4GYQnlCqQ9pGPu5+AJ7T IGrkHsEmye3/yoSf8EtSv/gfzBApbS4lT+RnjRvo8SiOXG9WWzKZdZJNE6q8E2IwaQw9 oC6zoqxCDFiWZm5tuTBtPY6Yyn//obzT3atgoUG1msi5uO3+HPGoCHSeMDpELQV+id6m ZDmoIivrs0H37fcypc8indYgSHBVkDxB4MpVblkfqfOE3qjGsnuNCGdLnZTyKB0L2QXr +13+uIZNXyJTFc2B6ax26bI0d5l1jQW4ti4O+lVMe6+5d7xeaWTh9HSnbIpVW6vZKCsb O6Lg== X-Gm-Message-State: AOJu0YzIHa2wEVZqedE79LQtaK9xKfPzz2obNhJC47HXzXz/ZBWkDGxQ KYZuCRiBW1c6pR9oqlF/KJKW/Dk1DJ+pbtjsNyuMyeo3cy3GIROlXtmZMmBS25zDikmoKAPp8T9 7g8uCXrAzocDBvCxjzbJLeYv71qmkMhnILz62v4fImbxgG4RY/w== X-Google-Smtp-Source: AGHT+IEZW5BbufVZPf+pTK1Dq8sxIthp/LqzWBakdB4kPIldYv1yvKEaOq6TR6RStWB/4Sv8Ms2kOO12ynnI7C9R0dk= X-Received: by 2002:a17:906:f854:b0:a43:21fb:d0db with SMTP id ks20-20020a170906f85400b00a4321fbd0dbmr5447127ejb.10.1709067211098; Tue, 27 Feb 2024 12:53:31 -0800 (PST) MIME-Version: 1.0 From: Bart Schaefer Date: Tue, 27 Feb 2024 12:53:20 -0800 Message-ID: Subject: Nofork and preserving newlines To: Zsh hackers list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 52624 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: On Tue, Feb 27, 2024 at 11:25=E2=80=AFAM Oliver Kiddle wrote: > > Incidentially, trying to use kill -l in that > manner, it becomes apparent why the `...` and $(...) forms strip > trailing newlines. Given that it aids compatibility with bash/ksh etc > and updating old zsh scripts that use $(...) I'm not too sure that it > preserving newlines is the most helpful behaviour. Parameter flags don't > appear to work with the new form so adding one of those isn't an option. You can do ${=3D${ ... }} or ${(f)${ ... }} but, correct, not e.g. ${(f) ... }. Consensus during the discussion seemed to be that the extra layer of braces was not onerous when needed. The intent was to have ${ ... } act more like parameter substitution. It might be possible/reasonable to have ${ ... } strip newlines and "${ ... }" keep them, if that feels better. I suspect there are not very many old scripts that use purely builtin commands in $(...), and as noted elsewhere there's really no reason (other than no newline stripping!) to use ${ ... } for external commands because zsh optimizes out one fork in $(...) already.