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,HTML_MESSAGE, 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 16E912238C for ; Wed, 14 Feb 2024 16:37:20 +0100 (CET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1707925040; b=Iy0zwvgQbwzEDdwV5gcod4KYgJCNkxWSLiffqFagLh/peV0MWuHXK+w49XQ9pxWJpxdNfVUyzE FvQqlbGBF8dO+YskcWsDRzcw88Ty2vgDQxv1eVtlzK3+R9HL6FYFhrieI1MSeIb138j8y54GJs Jt3gjoiAn3jJZb+1GNw/a2HPHUAeM8jKmSTUA6WevWpgWAuFQGaJzHta64Dsx2iz74JJoZ13bl 1Jf/2pTRfSxpjJY0RUTY155alkO14M47Istoh+TUEn17BiiBCwUxQy1z6vDo4eOd4Pv6vebZqI TaBugiKoS52OwjK5Xulv6fplh0zRgoZrDT6NgmvS7am6YQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mta03.eastlink.ca) smtp.remote-ip=24.224.136.9; dmarc=none header.from=eastlink.ca; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1707925040; bh=LcllfHqrehHVDqxhog01cw7HQ//BAxqv1JuCW7NaZdk=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:From:References:To:Subject:MIME-Version:Date: Message-ID:Content-Type:DKIM-Signature; b=THqlu9jCcmeJgaUbVBkOo9l1XET82sHnsX3gwL2HvPhhVvyjY8MzzcgEHtdH5RwFAzfmHGdAXk zpnQXNPICXfz9LrZgoL840BJ3yy7IAiTkVXsCpz+opmOES0LSDHap35tL+1EA3rh6qE3lYwS5o vb1JW6bC6AkWVxhLbwcfOnz7jI7Us8+49N99KZRKu7JajAxA7h+PwjCc6oplDQnhxluh5EcfR+ mSzaWGCO9AuBRvzwikVmB4GO8zPh2k7NHZ+SsuLNpeQeu5PO4DmUShRNbvXHjyBayzulgdMMVC ZSEUEudo2Sxp2E+N8wrtTRpno1+0khTr6+n4lQBXd+8nMg==; 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:From:References:To: Subject:MIME-version:Date:Message-id:Content-type:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=k8uUQlfkRIEogtUkrEVgL3aGuw57p5v20iDeeysB9TI=; b=APh6++edgoeGLBqSrHbwIiO4Kv g7r4BAB5uzBk9ziHX9h3g/R8Ghmb0J+lEKRoNdk8M2ly71EzRH2xyG4xTNd+ozOiW9lGdzMksmLr7 HjIQKHBU9BdU/dlGh0KG14FMQkyA7i8jjo4Q23Gpde6kjEpZSJFDryJJ7MtG8IrKyLJuuiFgxupLr 0hfEJPpNNiiUJZf8z1eKwXkPupdCJGvM1EN9tQcDTPIhfjfVCd0Q2UbU3+jYKfLKiR8rXk+7/Xn1E CTpofwgjHnY5Obc9d/VyWOM8WaqEGpf8tclM0FihUvMsqhKeOFLZqidNHCDtdwuUpZ1yfbBdi6Kjx TJFOM5Eg==; Received: by zero.zsh.org with local id 1raHK3-000Pvs-KS; Wed, 14 Feb 2024 15:37:19 +0000 Authentication-Results: zsh.org; iprev=pass (mta03.eastlink.ca) smtp.remote-ip=24.224.136.9; dmarc=none header.from=eastlink.ca; arc=none Received: from mta03.eastlink.ca ([24.224.136.9]:59341) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1raHJA-000PFa-0X; Wed, 14 Feb 2024 15:36:24 +0000 Received: from csp01.eastlink.ca ([71.7.199.166]) by mta03.eastlink.ca ([24.224.136.9]) with ESMTPS id <0S8U1VA5VQXIHGJ1@mta03.eastlink.ca> for zsh-users@zsh.org; Wed, 14 Feb 2024 11:36:22 -0400 (AST) Received: from [192.168.0.11] (host-24-207-19-13.public.eastlink.ca [24.207.19.13]) by csp01.eastlink.ca ([71.7.199.166]) with ESMTPSA id aHJ7r0FO3YTKjaHJ8r6Rgz (version=TLSv1_2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256); Wed, 14 Feb 2024 11:36:22 -0400 X-Authority-Analysis: v=2.4 cv=dL0Fm/Zb c=1 sm=1 tr=0 ts=65ccddf6 a=e7T7DzMKK1R988ZCg0wLyw==:117 a=e7T7DzMKK1R988ZCg0wLyw==:17 a=r77TgQKjGQsHNAKrUKIA:9 a=kdt9HAj0LZRJhaKLoJAA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=pGLkceISAAAA:8 a=nIWScEJTTXgv-e--yLkA:9 a=2FGqWuEiDfChEZeS:21 a=_W_S_7VecoQA:10 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudejgdejlecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfgtefuvffnkffpmfdpqfgfvfenuceurghilhhouhhtmecufedttdenucenucfjughrpegtkfffgggfuffvfhfhjgesrgdtreertddvjeenucfhrhhomheptfgrhicutehnughrvgifshcuoehrrgihrghnughrvgifshesvggrshhtlhhinhhkrdgtrgeqnecuggftrfgrthhtvghrnhephfettefhveeguedvleeggfdvvedufeeuudffvdfgledvvdfgtdeigeeuueelieefnecukfhppedvgedrvddtjedrudelrddufeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvgedrvddtjedrudelrddufedphhgvlhhopegludelvddrudeikedrtddruddungdpmhgrihhlfhhrohhmpehrrgihrghnughrvgifshesvggrshhtlhhinhhkrdgtrgdpnhgspghrtghpthhtohepvddprhgtphhtthhopeerredprhgtphhtthhopeiishhhqdhushgvrhhsseiishhhrdhorhhgpdhgvghtqdgkihhprfgrshhsfigupehtrhhuvg X-Vade-Score: 0 X-Vade-State: 0 X-EL-AUTH: rayandrews@eastlink.ca Content-type: multipart/alternative; boundary="------------X7P6OmH7kBX262hvJtL0A1U4" Message-id: <0b3cf56b-004d-4a9f-a643-a53ccb50e278@eastlink.ca> Date: Wed, 14 Feb 2024 07:36:21 -0800 MIME-version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Counting characters in command output? To: zsh-users@zsh.org References: Content-language: en-US From: Ray Andrews In-reply-to: X-Seq: 29669 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: This is a multi-part message in MIME format. --------------X7P6OmH7kBX262hvJtL0A1U4 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2024-02-13 22:49, Roman Perepelitsa wrote: > Right, command substitution. In my opinion, it's unfortunate that > command substitution in zsh splits on IFS by default. I wish this > wasn't the case. It's not even common that one wants to split command > output into words. Lines -- perhaps, but not words. So the default > behavior in this case is rarely what is desired and has to be actively > turned off. What are the vectors?  First must be logical necessity, second consistency -- avoid strange exceptions -- third and fourth would be helpfulness and tradition, with old-school guys favoring tradition and guys like me favoring helpfulness.  I've spent more hours trying to get splitting issues correct than anything else.  Characters, words, IFS, lines, elements ... it's the  most obscure and confusing part of the shell.  Lacking any focused explanation of the entire subject what I do is just throw saved snippets of code at problems until something sticks -- it looks about right, but even there I might think I have line splitting when it's really elements.  I wish there were enough of us on this list to put things to a vote sometimes and in this case I'd bet that Roman's view would win overwhelmingly.   I myself almost always want lines.  Or elements. Sometimes words, almost  never characters. --------------X7P6OmH7kBX262hvJtL0A1U4 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

On 2024-02-13 22:49, Roman Perepelitsa wrote:
Right, command substitution. In my opinion, it's unfortunate that
command substitution in zsh splits on IFS by default. I wish this
wasn't the case. It's not even common that one wants to split command
output into words. Lines -- perhaps, but not words. So the default
behavior in this case is rarely what is desired and has to be actively
turned off.
What are the vectors?  First must be logical necessity, second consistency -- avoid strange exceptions -- third and fourth would be helpfulness and tradition, with old-school guys favoring tradition and guys like me favoring helpfulness.  I've spent more hours trying to get splitting issues correct than anything else.  Characters, words, IFS, lines, elements ... it's the  most obscure and confusing part of the shell.  Lacking any focused explanation of the entire subject what I do is just throw saved snippets of code at problems until something sticks -- it looks about right, but even there I might think I have line splitting when it's really elements.  I wish there were enough of us on this list to put things to a vote sometimes and in this case I'd bet that Roman's view would win overwhelmingly.   I myself almost always want lines.  Or elements.  Sometimes words, almost  never characters.



--------------X7P6OmH7kBX262hvJtL0A1U4--