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,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 0BFCC246A1 for ; Mon, 15 Apr 2024 00:01:37 +0200 (CEST) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1713132097; b=f7zVozNstODH1cKVqhLscuYgAvbVDqFnT5oCE9vypHUA/jg9l77YDc/u/eSRFFpcF+olyllXN9 cYpK4YqIOb8JnA1si5C57fjDjK22CWUMtzSMMZynBfyavuTJ0/xPH3tF5dPCIY5LX5C5aLZ/7+ k/bJbs00jWKzd+gZi/gunNWsvTgA5IKaEdglUiWPZpeD3IO4Yw3xHFae8Eoh9tdZHPY8Gg9UUB FsGckKMrTv+2CjKdAsppTpCydhdkxg08bKaPef+yrjSb5boeUIprvPobDko/IFgwozNo4AhXdo qhsXsnyEvkKn30/MZ+H6hx2TMztK50cNzJiMT1a9wDmI5A==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mta01.eastlink.ca) smtp.remote-ip=24.224.136.30; 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=1713132097; bh=wFGJU2EBvaP4Mpm3IKws590zEsw+FledUhDeUr/rbus=; 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=fme+SAX4mltwgslg1VpgCHWKw8xNpC0OjmY3qjDmI7ct+/K/s8aSa6imBvGrcFt4AbdkYR7GHF vI+dKqF81F0Ro5rKud4ynZybrl5OUnMSaopteRkuf8nEodw5iTGhLNEAtBPBGWYiTOSif70FWb pe1V353r9RxC5tSidkJBpp9F/tPkCZ6DeleRjb4k65bnBv26oDjXslXHr/zSZFcZF4ZYrBz9xL TVbGn8bv4BDRchdxjhfBtmi2smbU96FrtTohp6eJbYFrtlUgqqC+MnRGT7ua7S1vbOeZVi8xHZ PcpvpkRvZIn7+rHHHFjKzpnscLEY10TBWbxJq5hjuiDS/Q==; 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=e5Q9l8uj1C+tfb075YzVRS3sBdvEIQ874QW3HNqYxVM=; b=TGxmD/s/+kt6+ShCE6+iWLF2+C 6tPSX8CWYSiqKuPYUrz4r7IDX8kKgg53be/jP9qBogYdwKF8bGiL5Fg5JCbEKy8cFf/W5wEy06Gwd DZIO/yZLxSA0NEoDlt/CV1vtoBuRy2k6QD4wlmmAyIcBvPoiNcd6MtIBXVcFscKwuibaPsszuu7ph VfXX+Y4XAC7jbrQ6aBjNwQ/mcH6VX/CDRBRpjQMZTtmwxuZrpHWfoGPTFiR6DvH+8hnDs7rT2xTkH jEUvpjTK6ZhH4GU74EYqW4sSzqY9wLpfJZUZY9IkrACcK+e7asOW6LaS12NuXQnFBCYH1W9xJW5FA IKePHGvA==; Received: by zero.zsh.org with local id 1rw7uq-000EUO-06; Sun, 14 Apr 2024 22:01:36 +0000 Authentication-Results: zsh.org; iprev=pass (mta01.eastlink.ca) smtp.remote-ip=24.224.136.30; dmarc=none header.from=eastlink.ca; arc=none Received: from mta01.eastlink.ca ([24.224.136.30]:33893) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1rw7u9-000DmB-10; Sun, 14 Apr 2024 22:00:53 +0000 Received: from csp02.eastlink.ca ([71.7.199.167]) by mta01.eastlink.ca ([24.224.136.30]) with ESMTPS id <0SBY0L9VXD4VELD0@mta01.eastlink.ca> for zsh-users@zsh.org; Sun, 14 Apr 2024 19:00:51 -0300 (ADT) Received: from [192.168.0.11] (host-24-207-19-13.public.eastlink.ca [24.207.19.13]) by csp02.eastlink.ca ([71.7.199.167]) with ESMTPSA id w7u7rkObY5Tsrw7u7rEbGp (version=TLSv1_2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256); Sun, 14 Apr 2024 19:00:51 -0300 X-Authority-Analysis: v=2.4 cv=deIj3mXe c=1 sm=1 tr=0 ts=661c5213 a=e7T7DzMKK1R988ZCg0wLyw==:117 a=e7T7DzMKK1R988ZCg0wLyw==:17 a=r77TgQKjGQsHNAKrUKIA:9 a=pGLkceISAAAA:8 a=x5YnUelClxIEOBxesNkA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=Pt4qZrP2GRiNIzC7HwcA:9 a=euoL6HP-aT7puUlO:21 a=_W_S_7VecoQA:10 a=lqcHg5cX4UMA:10 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudejtddgtdehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecugfetuffvnffkpffmpdfqfgfvnecuuegrihhlohhuthemuceftddtnecunecujfgurheptgfkffggfgfuvfhfhfgjsegrtderredtvdejnecuhfhrohhmpeftrgihucetnhgurhgvfihsuceorhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrqeenucggtffrrghtthgvrhhnpefhteethfevgeeuvdelgefgvdevudefueduffdvgfelvddvgfdtieegueeuleeifeenucfkphepvdegrddvtdejrdduledrudefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvdegrddvtdejrdduledrudefpdhhvghloheplgduledvrdduieekrddtrdduudgnpdhmrghilhhfrhhomheprhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepreerpdhrtghpthhtohepiihshhdquhhsvghrshesiihshhdrohhrghdpghgvthdqkghiphfrrghsshifugepthhruhgv X-Vade-Score: 0 X-Vade-State: 0 X-EL-AUTH: rayandrews@eastlink.ca Content-type: multipart/alternative; boundary="------------bEVz0VWp5hC8j0suSXsnPyS9" Message-id: <6822b043-a40d-42a3-b2fc-e0da6312ba88@eastlink.ca> Date: Sun, 14 Apr 2024 15:00:50 -0700 MIME-version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: triviality regarding $# counts To: zsh-users@zsh.org References: <97793422-1543-4ba6-b52b-ff93eba03ab1@eastlink.ca> <0a0b9ec3-4661-4386-9fbf-b3152a46001e@eastlink.ca> <9416dc0a-3e41-4229-a9e1-239411ab3c17@eastlink.ca> <4a1e027c-a9d8-4306-bf3b-e1282914644c@app.fastmail.com> <4e9aa98c-9b5d-4e22-b7fc-8c50a9af9ada@eastlink.ca> Content-language: en-US From: Ray Andrews In-reply-to: X-Seq: 29833 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. --------------bEVz0VWp5hC8j0suSXsnPyS9 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2024-04-14 10:42, Mark J. Reed wrote: > ...  That means all of these assignments store exactly the same thing > in the variable *x*: > > *x=this\ is\ all\ one\ word* > That one is new to me.  So a quoted or escaped space is no longer a word delimiter.  Yeah ... that's why in typeset, any naked space is a delimiter, even a dozen of them make no difference, they are 'just' delimiters.  Yup, this kind of thing won't catch me again. > *x="this is all one word"* > *x='this is all one word'* > *x=$'this is all one word'* > *x=this\ is' 'all" "one$' 'word* > * > * > > The ability to mix and match gives us the old way to get an apostrophe > into an otherwise-single-quoted string: to close the quotes, add a > backslashed apostrophe, and then go back into quotes: > > *x='That'\''s all, folks!'* > Geez ... that's dicing with the law. I'm seeing: 'That' then an escaped apostrophe, so literal,  then 's all, folks!" ... three ... dunno how to say it ... three words joined into one. > > > But it's easier to just use ANSI quotes: > > *x=$'That\'s all, folks!'* > > Yes, that's clear. > > -- > Mark J. Reed --------------bEVz0VWp5hC8j0suSXsnPyS9 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

On 2024-04-14 10:42, Mark J. Reed wrote:
...  That means all of these assignments store exactly the same thing in the variable x:

x=this\ is\ all\ one\ word
That one is new to me.  So a quoted or escaped space is no longer a word delimiter.  Yeah ... that's why in typeset, any naked space is a delimiter, even a dozen of them make no difference, they are 'just' delimiters.  Yup, this kind of thing won't catch me again.

x="this is all one word"
x='this is all one word'
x=$'this is all one word'
x=this\ is' 'all" "one$' 'word

The ability to mix and match gives us the old way to get an apostrophe into an otherwise-single-quoted string: to close the quotes, add a backslashed apostrophe, and then go back into quotes:

x='That'\''s all, folks!'

Geez ... that's dicing with the law. I'm seeing:
'That'
then an escaped apostrophe, so literal,  then
's all, folks!"
... three ... dunno how to say it ... three words joined into one.

But it's easier to just use ANSI quotes:

x=$'That\'s all, folks!'
 
Yes, that's clear.

--
Mark J. Reed <markjreed@gmail.com>

--------------bEVz0VWp5hC8j0suSXsnPyS9--