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 7F1EF2679D for ; Fri, 8 Mar 2024 02:30:12 +0100 (CET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1709861412; b=saI1yiX8ttiegd3aGQWEQM5aRBuFcyrVYDPSSM93xUaRKCfZlARKuZTKBeRBoBLHVHXLDcIzGo vRhWQxDmNn8cXfQVgTDJdnhv/4xdQqRhFGrfVgLzyJVd5TcqjU6+yoOIPNFZGtPCHIrD0UV9EJ ZundmjOHkeusIzQNz0m1rKYeenWJ7iU9K2INnQpdvxyuuQrKtxJ06y//0anji+n07GjD7LCrWd x1kHCeVWffLKqbypU42COtAHUf5GN5ENOLQtcRzRwZh6ZBKz/kXJy8a81od2LcHnWnLxJusgjv ugQAX4TWojJnlot3kf4x56rgPNkvJPz0NIVgJGYLfA4WfQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f48.google.com) smtp.remote-ip=209.85.218.48; 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=1709861412; bh=lNHnz2fvyHsAopp9h+nDUgUbsZ6l6S3olvGSkR7Ra4s=; 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:In-Reply-To:References:MIME-Version:DKIM-Signature:DKIM-Signature; b=KDaO1rGEinKKUwBqmeKFRy4tYoLGzZxqH0g9h/d2aYcJr06/CnNqkGgW4G7+GQhEF22AYy8ru6 A7aoOtgsEE4yDHFojWjebyRiF2vZrmpq8bdFPS99NinDN+OLN9NwTnIJxw/18DbRWv7+afOeBJ FIIQUQyMbnfH+mlLBFpcgL1WSX9C7NAcCee+zMqo7A9Gx3YN7r9gKRCqbSYCaZ2tbz0Jk57qIe rG92Ul7N9rhtFa6aENw3zphE2mTALTmV67rA/f3NSXI663CvxbS0bqcD8VxRKQ0cFbeTru8oD1 85Bxby5yiFYNNmslQOPAEQErIPs3/CSpVPtNLObqmY+FDQ==; 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:In-Reply-To:References: MIME-Version:Reply-To:Cc:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=rbz7mMVBWMm9p9NR0OV6NgIL5b28tnfdXgmj1grTdWQ=; b=U3DRoVMas8E7Sg3h6+iiVk+iEV YmoEZEb8nnm6eKFE7qIkDq173Fx4FOx4cOTRlIwwLcQ2gb4xt5nm/8dG1KH2SmOvHeoANQB+TFmbQ hbkT1Loqo35haxy5RukO5oMCclHhcMXDQqBWiEvCdiCuhcSO6Y2Cv7NlFdIJcJyaGbiFPN0VICm14 a2McvTU121T3bg618pXRVIhmkEW1YDnmpRKJmNJwbbYUV3SBcy6Z9CizWap5O6m63peisB7DYwTOc Ff0fgKENqhioY1G4Mr9oorQiy78hKSSZKGuY04w3JgkacyrO3cugdeHFL6GeuoNP6BPQp0G2dQRRP SJkJ5C/w==; Received: by zero.zsh.org with local id 1riP3r-000Jlg-VX; Fri, 08 Mar 2024 01:30:11 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f48.google.com) smtp.remote-ip=209.85.218.48; 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-f48.google.com ([209.85.218.48]:53400) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1riP3Z-000JSJ-Q0; Fri, 08 Mar 2024 01:29:54 +0000 Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-a458b6d9cfeso45965666b.2 for ; Thu, 07 Mar 2024 17:29:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20230601.gappssmtp.com; s=20230601; t=1709861393; x=1710466193; darn=zsh.org; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=rbz7mMVBWMm9p9NR0OV6NgIL5b28tnfdXgmj1grTdWQ=; b=NotT+oo+IvV0jij/VQY79JavPlmkf7K+EftyJzgpNynAvo3gWx6T+7mT7j3WeTHYtq +yosJLmackOPAKUDKGSNGYnW4eQIcJ7/LNy2N0WxsKUQidSidcQ4ENqV4RJoMF+nn5rN /6mC09E7pdLRi1TvGMu0sd1ywD+BxszOpnwemDh3u/Sj0qahwNTQk4lDeCc0/1BZjPZs nyPBQlk/JiRquqSQeHVfS2WYPJ2D+tYxGVEl1UNWAt4VU7aG0DbApcRQfKDU+7Xa7xdm j1td9ftF9AyJy2LAAYOeEA5QtwL0BY7VcjazhSTXHtfjgmwdP/y5fIPAKbVlqyH0Qamt obpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709861393; x=1710466193; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rbz7mMVBWMm9p9NR0OV6NgIL5b28tnfdXgmj1grTdWQ=; b=aYUybQKilYyK3rso5IonNzdsvqUiI08R7u2OBrrHXcdMDPZgQ2ZnorTE8z2TkM5ZcX A/TN8aMrIw1gbAe9fIJKxMvU1ZXwoxkbRH9AYjHGF8mcVTZjj/x2ZE9zXHeWft8OJzJo IAMJDbF/jjUFZRz65x37onfczqvfgXaz3NEFy0J/CDrjS2V48zrE5XiLN1RyhN6xrcvh I1T8CTaZdaDzmGl1ISzWTVAX6k2G+6/kV4VE+sVYWtq6xVAr50rlad3+mgtT9gMfZWxm rnrzx7g2R/ka/QN9bpcEVsel3Q1vfLGde/dx8EnGp12pJ2NrvktohEzxjMgZ6pfoCrNx eIaw== X-Gm-Message-State: AOJu0YykIJHbxmH+DmmAlHYhSmUyENr3zCel7HsHROp/JEN1Zy148//n 8tIl00dh9YF0nP9WdPkEsbhweQnJ6+0DPDZw2li40b386KTlUtqn7An+vB1tsucVlBlORXaK2L3 vsuwVwww6dZaU33KuwLWmnAhX3aUI3aDLYnwOmRrWfJOEXLk= X-Google-Smtp-Source: AGHT+IHey9Ght1xGPvhA/pJa4y53mt26YPk47KL0F5US6urZ6gO8W6SQr71JK3hY4drdi0kZC0foXynqKFaVYV7jvhY= X-Received: by 2002:a17:906:3941:b0:a3f:ce8:1234 with SMTP id g1-20020a170906394100b00a3f0ce81234mr13474023eje.68.1709861393083; Thu, 07 Mar 2024 17:29:53 -0800 (PST) MIME-Version: 1.0 References: <20240305065606.ccr2ieheahslcpye@chazelas.org> <20240306175711.t3uz2sery3b6tbjw@chazelas.org> In-Reply-To: From: Bart Schaefer Date: Thu, 7 Mar 2024 17:29:41 -0800 Message-ID: Subject: Re: [PATCH?] Nofork and removing newlines To: zsh-workers@zsh.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 52711 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 Wed, Mar 6, 2024 at 11:02=E2=80=AFPM Lawrence Vel=C3=A1zquez wrote: > > Hm, would it be feasible to create an explicit LF-preserving form > using a different character (e.g., ${&cmd})? If so, would it be > undesirable for some other reason? Other than that we've just about run out of characters? ${< should be reserved for reading a file, as already suggested elsewhere (no, I'm not going to implement that yet, though it seems to be an undocumented ksh93 feature). ${> might work, but it "looks wrong" to have a command instead of a file to the right of the pointy end. ${& looks like you're running something asynchronously, or perhaps changing a file descriptor. Every other character already has another meaning in that position, as far as I can tell. There is one other possibility: ${||command}, that is, ${|var|command} with an empty var name. That's already passed through the lexer, so it could be picked out at the necessary place in subst.c (I think, haven't actually tried yet). It looks a little odd, too, given "||" usually means "or", but it's at least sort of logical to treat "assign this output to nothing" as "return the output in place", and the other ${|...} forms do preserve trailing newlines.