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_AU,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED 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 6EE2D23C67 for ; Sat, 13 Apr 2024 19:28:03 +0200 (CEST) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1713029282; b=G21L6W1ps+7neZmdXaT2h/SQacNk6Y2ujLKcNvVwWGxHAY21jwLpVxGEaP+M+l/J+Icu8G96O3 Ol3es42i8VigtHxbklu85fhRq1iNy4uIFc4Y5wiW5d60Om0vcQD5KesSubsBPvADKZX09kgjW4 VAUGOMWYnB0co8dqOm4p41LV58JFw7REFUZZhMeNys0k/f6f+jJ4EvzExOPFCTwnzkuKh2Axwy gBraX24D6CY0ltrUIcLFWwvm6RbTpYDlg9Y9wM6r9Pr9J+cB6dLwVjLt9bNXZATKEeCn+N+evB 78ROWvG2iA9f1jJJdBuTBFloLWQZFsP8VKHN7gkbdu2YYg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lj1-f171.google.com) smtp.remote-ip=209.85.208.171; 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=1713029282; bh=ip4B4CUr2LSOccUermR5JmSR7kmMq6iqPPuzxuYr4kI=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=klxlRcxxHhs5waj8o7qHhi0XvOuRxl044hFG+xzdk8ZXjCsLAq6XaA1ox8h5kmDwb2Qe/Vm+Eq FjR+6J24jISvx6wjrICpaii/rC+9BS2q/iQ+OqMuvsMnu3x4g50DYxWUbOPHeGfgWPgnw07Yo0 T3xNqeZT7AO+950Wo7dgKkDqmaiUuIl1YZ8+qLUmGpzmnFDXJENeYk6/gyHADiMwVyxyaOYu/t mcZZaIZbntoWyerOPcW7FKWtkk/UFuErq91+qBF2YpqRmgdTSKu3+bXE8H9oSYPFy1vc/WJ4wF 8Xg6w8K/qlNpQQsxryjhWxxUN4kAnUgg0yliB6fVXJ9y6A==; 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-Type:To:Subject:Message-ID: Date:From:In-Reply-To:References:MIME-Version:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=ip4B4CUr2LSOccUermR5JmSR7kmMq6iqPPuzxuYr4kI=; b=ndE95UzEGJT0TjH9cuTt1c9aRn JCrpr5tRsvs5Igh8asJjo7s1lvVz3coRFeLxbX75LvIBREX8maI4tGx6nHITgrnm7pkrlUMIbnqMi thVOs+sYt0nzIc8qmVv4++JCoyzIrVQgA47Z0yQt30s92tNqk6GojdyL/XXskpcqwti/a/rJuy4WU wM903Of6yT8m6kzBOAE0ggVwgFVlJb7A7a6ZxOWZ8jsxlGQ7AYQ4sTQer7NZ1YlNrgyts4p2mNAlN Lp8k5dLAM5iHpdsgKHMhjA6RaTMsSpc3AtytOyBxwUidr482NoPLlAZBrwv/SzFaBp/NTOnjvBUFx gyoGGz4Q==; Received: by zero.zsh.org with local id 1rvhAY-000IW0-RZ; Sat, 13 Apr 2024 17:28:02 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lj1-f171.google.com) smtp.remote-ip=209.85.208.171; 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-f171.google.com ([209.85.208.171]:55501) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1rvh9w-000Hmo-D9; Sat, 13 Apr 2024 17:27:26 +0000 Received: by mail-lj1-f171.google.com with SMTP id 38308e7fff4ca-2d9fe2b37acso23218961fa.2 for ; Sat, 13 Apr 2024 10:27:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713029243; x=1713634043; darn=zsh.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=ip4B4CUr2LSOccUermR5JmSR7kmMq6iqPPuzxuYr4kI=; b=YZttoFjxltJvZUp5fOwUXvS5jP2+RTi4djcMPuCrV6+Ej9gSxfTkG/ob/KOMY6VhVa P4MCAHGhJHvzAINU/tX5tJhn8MXtshfNRFC87wLn9f38L1uwsY6i4Yf1xT7gaV82/Y/m W8LRw1v+APEy0buv29fjYrpQXizGu6bp1deDymuoqIbRFQVG+SxYMrb+9HPero92+ZS5 4iXJYZ/ZMFdjwFbyiMvqGrhc/y31SXjVZKwnyOs/zUF7OW+eXdL+s5tF3uoskMgbYSsN t8hX1uVmfi4sWO95vijZUpIjZs7HVTMWaIEkofT7ZoBGzod8dCvdN1KF5VwkKhCFjmel fG1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713029243; x=1713634043; h=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=ip4B4CUr2LSOccUermR5JmSR7kmMq6iqPPuzxuYr4kI=; b=ofT9fnMXn2jRW+g+/O56voM6NJTj7ePY6nTyYHT07+2RF8ObiR1nP7LbNBhNGP28hq HLvlfueJ3IxJKCCgsEnbDSdy4qX1VaqNwhahkxNrVTAj1uFR66flrbZl/EGCFEeZXahv zkFv13TqSjmbVhyuXoRB25NT+jDREQW8RQDvFiA0gp3RsyAqd0R8j7iCdTuYjYYXYzFY yOWdQvRKqGwcHTrbxSSWtLEO1Q34AfW00wFDPF4FWHgSZrX6yGnuQmAIwGViw99ifwT4 UZDSDCAeaI1NbjS6/CHihMgRuVg3MBfwMRr7fIEldOTXltkOqTwVg66USEc+LfpLh8WN KJpg== X-Gm-Message-State: AOJu0Yz/RRNmzp0dSiHWtm1+mH8DvkHIWd5foZxtpYNR8Dq9wFYoSm+n oMTzxknHpCaTzK8QxaCBKW1dWnkFUfdSWhbfaHo71GIUjPSAirY/IgXgud4kL6nP1crBAeCU3Za w7HRqFkRJjHFaWOubDDwO77rVAiw2z2E6OLI= X-Google-Smtp-Source: AGHT+IE8gJF/3DkfH4Lnztgz31jm+VwOUPja9c935XkPTJjOxyDbCXLYedHiWQHGZnHMUZY83tOxvEf4oXuGZSek/9M= X-Received: by 2002:a2e:b0c8:0:b0:2d8:6c9f:418 with SMTP id g8-20020a2eb0c8000000b002d86c9f0418mr2922532ljl.44.1713029242760; Sat, 13 Apr 2024 10:27:22 -0700 (PDT) MIME-Version: 1.0 References: <97793422-1543-4ba6-b52b-ff93eba03ab1@eastlink.ca> <7ba17739-6024-439b-a4a7-dd88fddfa2e4@eastlink.ca> <7333cf23-1fe7-4b3d-a7c1-f07697c5f062@eastlink.ca> <1e53a3f7-9bdb-45ae-81c7-7d0ec1a6a541@app.fastmail.com> <3cc19e86-e953-4e2f-9e57-30ff84f15fdf@eastlink.ca> In-Reply-To: From: "Mark J. Reed" Date: Sat, 13 Apr 2024 13:27:10 -0400 Message-ID: Subject: Re: triviality regarding $# counts To: zsh-users@zsh.org Content-Type: multipart/alternative; boundary="0000000000008134580615fdb362" X-Seq: 29805 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: --0000000000008134580615fdb362 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Small followup I meant to type but didn't: On Sat, Apr 13, 2024 at 1:19=E2=80=AFPM Mark J. Reed = wrote: > redline *'\nddd=3D( "${(@f)aaa}" ) ... it seems like a lot of trouble to > copy the array as it is.'* > > > That comment confuses me; you aren't copying the array as it is at all! > You've gone from *aaa, *which has one element, to *ddd *having 8 > elements. That's a far cry from "copying as it is". > If you want to copy an array as it is, this is all you need: *fff=3D("${(@)aaa}")* Or, if you prefer the POSIX syntax: *fff=3D("${aaa[@]}")* After either of the above assignments, *fff* is an exact copy of *aaa*, including any empty elements. (If there aren't any empty elements or you want to strip them, you can use the even simpler *fff=3D($aaa)*.) --=20 Mark J. Reed --0000000000008134580615fdb362 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Small followup I meant to type but didn't:
<= br>
On Sat,= Apr 13, 2024 at 1:19=E2=80=AFPM Mark J. Reed <markjreed@gmail.com> wrote:

redline '\nddd=3D( "${(@f)aaa}" ) .= .. it seems like a lot of trouble to copy the array as it is.'


That comment = confuses me; you aren't copying the array as it is at all! You've g= one from aaa, which has one element, to ddd=C2=A0having 8 ele= ments. That's a far cry from "copying as it is".
<= /div>

If you want to copy an array as= it is, this is all you need:

fff= =3D("${(@)aaa}")

Or, if you pref= er the POSIX syntax:

fff=3D("${aaa[@]}&q= uot;)

After either of the= above assignments, fff=C2=A0is an exact copy of aaa, includi= ng any empty elements.=C2=A0

(If there aren't any empty elements= or you want to strip them, you can use the even simpler fff=3D($aaa).)
--
Mark J. Reed <markjreed@gmail.com>
--0000000000008134580615fdb362--