From mboxrd@z Thu Jan 1 00:00:00 1970 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, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 10529 invoked from network); 5 Dec 2022 15:58:38 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 5 Dec 2022 15:58:38 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1670255918; b=qK/jg8AVl+lPJ/EIhzx7zyuaOPtpY3A0VaCkJfQbJHQWr1zwG83YiIh0WeKEeuGeeBHwMZ163t EpJZngYKL4lNk9xz5B0HZx84yBF2jU7UJvxrCETM/99fa7B+HW1jQbYgCE7C6B6R9XZQzsdSNp AM7YNYmqulmK/xRbIUaKC7Y5s63pt9SWbcqm9v2MYya/mikn7r/Fm8fzdsxkTSq1k5l4rSkzDo dT06xXYvC6rDawjqEtvU1HuSIIMptArEpEuhh2yV/PPAO289dbMWK6OooslEbBThOO4JD8thLX IySlh4bR+TSrqgX/sDEEIlsKEzx874g/Q4BzcpX5528Kww==; 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=1670255918; bh=7Pz1OYswjYCj9afCE3LCh6XlHCmovJa49vSzO+R3UL0=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Subject:From:To: MIME-Version:Date:Message-ID:DKIM-Signature; b=DsTVCDU+6WwhipoMTyWeb3VW7IWxc75+E4gx/luooesVbpBES2ywKbMazCrD4Srp6sa/7EZyZf U8QhhJaw+NyTljxJcvM9U8Yjs6M6QEbS8HFDN55IbfhPKGkplEtwbWAze2q5RQM17s29lnzDGp /0PPTfZ/GQZbfCfoz1cNFDxOWHRjcHoAFZCrDQ6dUWklkzMq6EKnPd7Hc529Xdpjf2bjeDK9ii XUHjPf7jEQu3zfsBBZonZdnaMTLzB+7i291oOJ1rTtdyQqTDqHeRdKtukMS5u15dw2VyptVUOf AvOuNvxcY6ELkBsMWfpb2O8eX3ivG7etaWpl1qWa21o4pg==; 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:Subject:From:To:MIME-version:Date:Message-id:Reply-To:Cc: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References; bh=QWyfzLq6gQoyUTOO9qNv73l3ONYVZwbC4wo+2zeU3us=; b=G1w+2H4navLMvrl4GqANroRba8 JvqXuU+kGKIP4I/jR/qXut6QIQE+42y76W2i8sj1LfYSjWkMJyB1s7F5zpJH5f8I3PqOSO1I7tqNE vFotZJM5eXhvcWj2jWI5cqqWur2QImRB7udNPacxRalNTcOJx3m2bn35691yrJ4EjR/PRqeAnNfsl imPwNQ7g037X1VOkJLKh2b5iQhPLkd1hOyr14pBai5+qDJS8/S7vUmegpPylsUJYArCuXmjdxKa5r 8GOkB6XgS1MrHle9FvFbjGT3VZhqkAbm+KtXZ+O7OhyeYtqnd/XCRB4Yc6hfq1al9Sa+YIDTSSfTx tMpdhGcw==; Received: by zero.zsh.org with local id 1p2DrY-000AHk-N5; Mon, 05 Dec 2022 15:58:36 +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]:56568) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) id 1p2Dqm-0009aS-7S; Mon, 05 Dec 2022 15:57:49 +0000 Received: from csp01.eastlink.ca ([71.7.199.166]) by mta03.eastlink.ca (Oracle Communications Messaging Server 8.0.2.2.20180531 64bit (built May 31 2018)) with ESMTPS id <0RMF00OC4CKFQ7F0@mta03.eastlink.ca> for zsh-users@zsh.org; Mon, 05 Dec 2022 11:57:46 -0400 (AST) Received: from [192.168.0.4] ([24.207.18.108]) by Eastlink with ESMTPSA id 2Dqkp5lNNEN8v2DqkpdHRy; Mon, 05 Dec 2022 11:57:46 -0400 X-Authority-Analysis: v=2.4 cv=IPDESCjG c=1 sm=1 tr=0 ts=638e14fa a=xN66ZtSbq5jdJYpBp7G/jQ==:117 a=xN66ZtSbq5jdJYpBp7G/jQ==:17 a=IkcTkHD0fZMA:10 a=FZfjSFBkNxWhfW0Y1zoA:9 a=QEXdDO2ut3YA:10 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudeggdekvdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfgtefuvffnkffpmfdpqfgfvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepkfffgggfvffhufgtgfesthekredttdefjeenucfhrhhomheptfgrhicutehnughrvgifshcuoehrrgihrghnughrvgifshesvggrshhtlhhinhhkrdgtrgeqnecuggftrfgrthhtvghrnhepveehudegteeiveevieeutefhffelheekueeghedthefgteejvefhgfekhfeigeffnecukfhppedvgedrvddtjedrudekrddutdeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvdegrddvtdejrddukedruddtkedphhgvlhhopegludelvddrudeikedrtddrgegnpdhmrghilhhfrhhomheprhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepreerpdhrtghpthhtohepiihshhdquhhsvghrshesiihshhdrohhrghdpghgvthdqkghiphfrrghsshifugepthhruhgv X-Vade-Score: -100 X-Vade-State: 0 X-EL-AUTH: rayandrews@eastlink.ca Message-id: <54bcd6dd-e589-4696-f042-1155b78df9d2@eastlink.ca> Date: Mon, 5 Dec 2022 07:57:45 -0800 MIME-version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Content-language: en-US To: Zsh Users From: Ray Andrews Subject: The elements of enlightenment Content-type: text/plain; charset=UTF-8; format=flowed Content-transfer-encoding: 8bit X-Seq: 28481 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: I  think I've finally actually figured out the reason that lines aren't elements and elements aren't lines even though they can print exactly the same:     $ list=( $( setopt ) ) ... We get word splitting and the option and the value 'print -l' on different lines and '$#list' is the count of the number of words/lines namely twice the number of options.  Good, fine, and understood.  But I want the option and it's value on the same line, just as if 'setopt' was executed at CLI.  By double quoting: ( "$( setopt )" ) we seem to have solved the problem, it prints correctly.  But trouble lurks in the shadows.   I do this:     $  list=( "${list[@]/ off/${red} off${nrm}}" ) ... And I'm baffled that only the very first 'off' is colorized. Why?  Because '$#list' = 1!  It looks like we have each line as a separate element but we don't.  It only looks that way because the newlines in the output are still in there, they aren't 'print -l' newlines, they're newlines in the data itself!! They look the same but they are *not* the same.  To really get what it looks like I have I must first:     $ list=( ${(f)list} ) NOW our element count is what we want it to be -- one per line and every 'off' get colored.  Newlines aren't elements and elements aren't newlines.  Finally!  I'll never be fooled by appearances again.  Do I have this right?  Only took ten years :(