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.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS,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 33D032121C for ; Sat, 13 Apr 2024 03:36:42 +0200 (CEST) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1712972202; b=SmML8zvXAP+7sFdumM2U2zWtTTIIVqhRlAVshZURV4NqpUoCe8fl1rQDaNCmMH14LFkvGkSS6L MSKIbkwlBkLWsqaL+o4a4EfxxObeF5U6fvcnzr+aOV0j9aKOudZ5ffsYiUDAUqadqK+q8zVnQU sA9OvQM5+Ad0th+hzTvdW0zdjBI+epy7aD7XaWiCk2DOPGTu5PX4U0qsQHEPCnq1QBFv0hYyQI xONTZ3LTOvU/T0SUBzBNRfZ9irCsGNcZdTglg/aqUzQE3fQGl36O4niRefNuN+yQw4Aatr/dUm CJJAEVU5TNgHFReDRbNV9zbtajkNZ9rloGbOv9onLdxoLw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-wm1-f45.google.com) smtp.remote-ip=209.85.128.45; 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=1712972202; bh=BGX3FW1TQVqvi90o1fnELxuNSuB7CTg6vTihmidWik8=; 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=iT0Ns9/0WJc98+YiqV7I+atsU0VVWFwzsLhClQR0qBrM8Xg7zpHKpyKvh0ZcoOUsxCSq9oE8Q6 2P/R+NeKrfaQHr04WjX/a7W4lnBUfZGmxrZepgMdlGsgtTDbOW8SO63ohEZ+l88u2jwGsGnrEC NObEfnIsF9wXJDar5zIRIfSz5602QXVOrTpD99/Gz6KGQ1Rt0uF7U0JyVhcs4lxIc95jnjsLq8 ZrxA5txYNqvRi3Y6COm6QY7gN9g7NTc/75bzC1X5aLx/JTVXdLHEuuEKcyKrM88pANxHLkuT34 RS9a8e0hW8Vk53VdkW0aDI7hS1xoLDRjq0aul1wJRKn/qA==; 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=eagNhf949kGquJgeHwuTZgUfp1ffG48k44Nci+INh4s=; b=CZLg5OBzwHwveybZEkZav+s6aF mxeF9VzvNgvcwSAKZESpE0SZQ8ok6vaTMl633iCGUCUs2xNMyglTKOG0pbbzolDP62z2FEP4UF34t oqzh60/EQ/0JFyGUZ20boaAoDfgsyG5i783yh+fmTN2KdWw4wAv/KJdy45X/6v5w7dlUaJtKcQ595 6NV3aDe7OdDxtajRBfzkX8C3lvqSVWTQiG2QWleMLkSnIJRL+78NYdl5dP64PVX1JGcqUDPe94XEG /XV4Y8StMWlUl5Po0bzzRV2sWI3MPS7ONIVylP4Eq5jFar4t7KvOCwouvO5eOwxhNE63ANQyoICb9 Xjo6zeyA==; Received: by zero.zsh.org with local id 1rvSJt-000DDp-Cn; Sat, 13 Apr 2024 01:36:41 +0000 Authentication-Results: zsh.org; iprev=pass (mail-wm1-f45.google.com) smtp.remote-ip=209.85.128.45; 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-wm1-f45.google.com ([209.85.128.45]:57838) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1rvSJI-000CUN-LO; Sat, 13 Apr 2024 01:36:05 +0000 Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-41804f10e36so6769215e9.3 for ; Fri, 12 Apr 2024 18:36:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20230601.gappssmtp.com; s=20230601; t=1712972164; x=1713576964; 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=eagNhf949kGquJgeHwuTZgUfp1ffG48k44Nci+INh4s=; b=v2Xm2J/xKUiDc4tVrAAG45OpS9RKptz5dU7q4cQUl8vmt3dHQ+NElgHoVTOeBvSECM nku9yQcSRWmyPNMqtd11aOb2FuOsjjqKPTVEl8GhjyMxN4ARYl7Ubu0VeLw6NXCbTs+p 8BaRVvfId097drnOJb8XoLpeuxoH5eJBmlod9HWyEjfg/l7HJLKpnDILoGqOkFJqxH+6 odMHfxUzd3RY+aaYgmxSthM146tKW9HVHjR3agHttwWtnoYluDCQY/contfLbi+ze4Xh hkvHmzf7Z6JeCIRk8OjxC8mLc6+AsxmO27TLCsrSeCGVfNtaWjDkiklc64kXUuIKYwcu 5IkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712972164; x=1713576964; 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=eagNhf949kGquJgeHwuTZgUfp1ffG48k44Nci+INh4s=; b=Li/Vk/bkavyL4e8TKoJN556S77ZckSOZkDJQe5FuTxvCLVl76q8IBt/1ScXiiL9KZ6 53ukMS6tlxTiSb3zzsSqJ+z+RJAof2e2kuntqMLwLwM97SPx5Rd5L/g8qNIuGrUSSZY5 7ByTaszfgu3m5cfbwzugrow8zJA4kXODUnahYILRf68rhE3Mtr6rqq6nPGJdDpRrHGA6 vDRoIZdohpT6ua0xp+KPNgSs4dRtXr279jsPLJxq2IzQXirArgehe5bpgkZDEc1geY1p u5TPJLZfUvZyPS0Af2KKzaONmGCYeEcRp9JEcLKIrAt8LnvCXN0bU2irkdk5DOX6SaoO +haw== X-Gm-Message-State: AOJu0Yxb3t23GrF72IoU0pbGH2TzbAzdil/3qizhvNbvjbB69/cW52jr FRfovzbIVXuMbrM562CMKgD3cOJLWVfvPQ9h9+SIXALLUy25M6yhDzEVcX0HZKj/7eL43dD0RDh mzf7bfXihp4sVZLKrWX/t7IVoIhPcMbn8l8NGlNt6MJoFKcMk6A== X-Google-Smtp-Source: AGHT+IGgCNE7+wZnmH0VXceIdjiAYbk+tmgQqnOSFl8LIP/pebFY+oFXH19K3flGjrm7y4YgCZjmD0IezVXq8BUWkp8= X-Received: by 2002:a05:6000:1a8c:b0:343:a4eb:b867 with SMTP id f12-20020a0560001a8c00b00343a4ebb867mr3186893wry.63.1712972164130; Fri, 12 Apr 2024 18:36:04 -0700 (PDT) MIME-Version: 1.0 References: <97793422-1543-4ba6-b52b-ff93eba03ab1@eastlink.ca> <7ba17739-6024-439b-a4a7-dd88fddfa2e4@eastlink.ca> In-Reply-To: <7ba17739-6024-439b-a4a7-dd88fddfa2e4@eastlink.ca> From: Bart Schaefer Date: Fri, 12 Apr 2024 18:35:52 -0700 Message-ID: Subject: Re: triviality regarding $# counts To: zsh-users@zsh.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 29799 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 Fri, Apr 12, 2024 at 6:13=E2=80=AFPM Ray Andrews wrote: > > I've got a whole bunch of that figured out today. What I thought were ar= rays were scalars that just happened to print nicely on separate lines wher= e wanted but not due to '\n''s. And what I thought line splitting -- (f) -= - did was enter '\n's into the body of the variable -- a guy might be forgi= ven for thinking that -- but no it's dollar signs. You're definitely confusing yourself again there somehow. (f) does not "enter" anything into the "body" of a variable -- it splits a string into an array, converting newlines into the breaks between array elements. I have no idea where you think dollar signs are coming from ... unless possibly because "typeset -p" will output array elements using $'...' quoting if there are certain non-printable characters in the element? > One thing: it sure is hard to hang on to blank lines. I wish there was = some option to default to preserving them. Again this is not making much sense. There are only two cases: Strings with newline characters in them, and array elements where a blank line might become an empty element if you got there by splitting a string. Empty elements generally get removed from argument lists if you reference the array without proper quoting, especially if you're forcing an additional layer of interpretation by using "eval", but they won't be removed from the array itself.