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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 540D4291A5 for ; Wed, 14 Feb 2024 07:50:17 +0100 (CET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1707893416; b=malUv6dLwG00i38857O9Ah3Pl0bcIVhcmUtXX+fhDFV0rfYGg7cYGNjGwuXwmYskHb8vgylHxN isKBQswDXuTtk5DI92X66h5YrF3T6dRKjc2lYreI3Ft+L/fLm1W7GUhjzO+9neAcHK/YfC1TfL 6r6j/DNN5IzGZdWPqS1QKrAp8C+MjUatVYisLpLYu+f7XA9kzu5GrwBHFTxeXMWJTqnjMkW9cR 3zrMmsXbR1on0I8DpajWZmQ6iMVpWPu463S6Ga5z7iHeofCBUvnLp6a/oyrUM/2ragt6VXeqEJ AzdABhPOT9B9QSs5mNaYA4klhQeVxE4LyYhILbs4zMiWAQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lj1-f180.google.com) smtp.remote-ip=209.85.208.180; dkim=pass header.d=gmail.com header.s=20230601 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1707893416; bh=8jUOFeHFa7VnQIboGftOKMVOddx2kGB5KGqXWLld1qg=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Cc:To:Subject: Message-ID:Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature: DKIM-Signature; b=GBR1QQnGKBEZf/WyiEuV16gc/VBqHo4VroiKd0qPs/tnd8imhSRFjVocMYUO0y6jpMnSWsV215 VFJhVOZdnsW6M8LP2z0dzHwSlsuNuw4St2DLPeTH2Pk7LSLTSzghKcQn5E7d8Ao/hHTO/02XC6 t2no3uy9JMjyAUi6/77OatE9ohiQSQes/NgblYQhB0EE9bW9v67ZDidPgi5ZSMjhb4AQLVvuhB YJzBJubRMI3NUgGM/q/a79C2ZYtFmaFESUQtXl4+At3XC4DCCDC7uDSW0QtJJ0fDBgEeiR+dfX zo/BAVBYjIdiALxqvj6pvIWu9wi/PvHAljWIzRJjvXAiLg==; 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:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=8jUOFeHFa7VnQIboGftOKMVOddx2kGB5KGqXWLld1qg=; b=rZMKGpXd/1ROeOjOgOk1TU1LJ5 VGMg7ktZKieVamN3TXlpvwBfc10SL5tbnSOM1243RiHqpUz0oWkZr8tGznIRHpSCKa3be2uSmkztR V0Cxqqe2lwgSpdjhW1d4xHRyG0Gy+ZjYdwRnRj7AGjVRTjA5/r1yjaIvwxnQOlLfUH5CCnUPLAYRx fHdR5FqSd7vsjOv4ezMGuD9h40xVDLZj7AKw+CV7kL4uzMpctVpr6N8Ai895nnhnKQ9hRsjEhqb0a jZE7amcWx8YHufyUIQQSurqzitog6R4M9L0JlgJPnPFpaYQp/H82Qp+X/EZTAQueKipSrZfx6Q4mv J9DyjwzA==; Received: by zero.zsh.org with local id 1ra95z-0009M1-V4; Wed, 14 Feb 2024 06:50:15 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lj1-f180.google.com) smtp.remote-ip=209.85.208.180; dkim=pass header.d=gmail.com header.s=20230601 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-lj1-f180.google.com ([209.85.208.180]:53595) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1ra95I-0008ep-ED; Wed, 14 Feb 2024 06:49:33 +0000 Received: by mail-lj1-f180.google.com with SMTP id 38308e7fff4ca-2d090c83d45so66626361fa.3 for ; Tue, 13 Feb 2024 22:49:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707893372; x=1708498172; darn=zsh.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=8jUOFeHFa7VnQIboGftOKMVOddx2kGB5KGqXWLld1qg=; b=nFCc94/O+TEnJbeO0HkZTTNFnLGGwj7CLQhHFhcIGHM8awo2VX8wO9Ad9imHWckR6y /4HwXJxy/N+ZzN2mFmMtcrPodJ01evq4Bc27zOiZA2vyeLf+lFyzIIy7baH1mL3QQ8i5 nDnvoo22KyEz46Ld/3M4euEV4f9149m3+3YnZQpty+1zC62TQ4JVY63dsyTR5xAnxSWx 6KzkzMhX6FxmYo4I3U6SL9BLNJB3qj3/E8DovMzlkUwgw7aGQlyU5P/7VoU8KW6LMUwh 40rDbZYUBUYuHN8CUSiRM45qcQ5brYQA5ju3KFumzC9u2VZ2U1sMsx5ZvS2UhzZ6VZy+ pGeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707893372; x=1708498172; h=content-transfer-encoding:cc: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=8jUOFeHFa7VnQIboGftOKMVOddx2kGB5KGqXWLld1qg=; b=AS2LB2RYpAVGuOwkfRg35j1sIIySHC0SQgb2NitgJespofSVJX9NlSexXmcKFx9jP8 Em/QaaSUBw8FCvaL/KHeZ/8W3fyxJ9/7Pbv9udktTJ+nlIR1Cu8q0ssriuB57Lcgvkzx wbLbGjQiiRtwrTaMuWfwovh8cVAml+alOio+eEWrWlUBsPS9qcFFClwSWfcikneF5H5G uFXtVU5SpbfMtt5x5zyvmrqmdtZr430VmOO619Jmq1KpfUgQpvp3WPvvEumDw7F8Jday 8CFNtcW23I8zPohyXZhxdYrC+fz/IrKtAboxPPizligg949ZoPUOsQORyZCiaEra+7oa vaiw== X-Gm-Message-State: AOJu0YzfBCKrQ8c8fV0crLZSuYiNqPMWcSmsS4oUh8PJZINYrsTnohC2 N+uoXcfOmG449w5CZpds0wcaN5GqS8ZVj79rYQO6BY+f4SzyfsDPNkvp8gvpHbRmcFKlrYtPKvM ECzc0yy3780IlQV+kOrdf9dIhTp8= X-Google-Smtp-Source: AGHT+IG7xKgzVSyGOKU0gqrIMkLOKl9OTihna9rp2dqJ9Kcq+9v5+ngol/8R1eMEs2v58cpLGKejYVkhTdGk7Wpd3dQ= X-Received: by 2002:a05:651c:214:b0:2d0:af09:e3d7 with SMTP id y20-20020a05651c021400b002d0af09e3d7mr1217159ljn.41.1707893371419; Tue, 13 Feb 2024 22:49:31 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Roman Perepelitsa Date: Wed, 14 Feb 2024 07:49:19 +0100 Message-ID: Subject: Re: Counting characters in command output? To: "Mark J. Reed" Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 29667 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: On Wed, Feb 14, 2024 at 1:46=E2=80=AFAM Mark J. Reed = wrote: > > On Tue, Feb 13, 2024 at 3:41=E2=80=AFPM Roman Perepelitsa wrote: >> >> Process substitution gives you an array. Quote it if you need a scalar. > > You mean command substitution, but thanks! It wouldn't have > occurred to me to put quotes around it to change what the `#` was > counting! 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. Roman.