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 50EED2272D for ; Sun, 14 Apr 2024 19:43:18 +0200 (CEST) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1713116597; b=qVIgtnO3BkIJqjK5lZ4a0wIlS+uYwgj41kWdbce5uqh91doVC1Eumd2sJFBQFajyw4NZ1jZO6X cnuUlA9Dhyc4DXmY9jBogRLe+41Sovk/gFZKZwRPchgtbUTeN4ef7U1p6LH0i8rr4uAVwaI7Lw cr9jxDg/7AWOLH2KKXJaIB1sUiIZJhhNf9r5ZJXhnNwtVDklTEe/jP7xNuxc+MfXG4EMRGKblE 6lcwblQObi9FQtq6ioc1MDqSqfAxHrhm2SepMDPxQ9f557DpScjsGCna4VGAnbWXvzYBStAUbo 9PNp/SlXlPmUY4YXRw+MOry12wHeWzlLrxsjghXwwnSZIw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lj1-f169.google.com) smtp.remote-ip=209.85.208.169; 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=1713116597; bh=FJh+oAYV010B1j3dEJXUWpgUyGMW168wDMd5Dn6dgj8=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=ebI+q1MBc6520YdapQY/FT2t4bEyzUjqlZKTTbHw/9hkDiudFCswKaEW0quca5iLOgHbIJYZgt xRWm2JzNFxXtaMXHzXz10LM010chxt/IYUs0mDmgnQ88xdWEvm1c9ODMGBTNrTN21XSbav5/Ye IVX7LhmcVbYY1kEvRiIMIxebvR1XluMZWmtTXZECLwamamlcXOAX88Ruj6M0TIDJgFq1iIIyZg e/wX07J/6Wi1pMzzuVnOGRrGSPpcHswoIi29L6FNwfwjEUKT3BxQsLiqaBKAKLnQ0jRLx9i+c7 jCz8lAjmq0oSGLXAFbSkW5Yq8QH+b2SvA2HZYuogkguSyQ==; 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:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=JnaPpEY0rtFJVXKUk6C2w0V6eSVoJq1c6yUE/tAZODc=; b=lekwA1z5YUr9xXsXGV42LTxxzk pKFMML3fiK6+G1hbHfUPdr7HB4urin9fvpeWI4dQUzKp1XGewLkOD1WSX3gUjEdvJFRISHw2ZVVKE gm7ZMQ7JbRY8IiJL6TESCw2bMQPAHymOuXviUohZv8jkfhTSQU/rdhVnR52vzonYcmdNxyoeorD1F nEStZJ30+V8cY1pZjhO6q3+F4CJbhwiz0sDqNpLA4P+2pFCne2XAa670qUtpC6Bmck3aYJFZylzgA 1hUALUBsd/FzncPzli3HfwT4eLBzqylB8itjxIW+QquXNa7xlm2tD2jTHipfTxPFXDKouGM7jjxqX Gq+vU4Cw==; Received: by zero.zsh.org with local id 1rw3sr-0005Aa-PZ; Sun, 14 Apr 2024 17:43:17 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lj1-f169.google.com) smtp.remote-ip=209.85.208.169; 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-f169.google.com ([209.85.208.169]:57454) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1rw3sC-0004TV-59; Sun, 14 Apr 2024 17:42:37 +0000 Received: by mail-lj1-f169.google.com with SMTP id 38308e7fff4ca-2d87450361fso31116051fa.2 for ; Sun, 14 Apr 2024 10:42:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713116555; x=1713721355; darn=zsh.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=JnaPpEY0rtFJVXKUk6C2w0V6eSVoJq1c6yUE/tAZODc=; b=NQTFcQFnSiNKAwTYElFGoUmsVwpM525L1o79Aou8wFkZogv0AsDFts8appWJl0omx+ KwaXv6CW9FLw8d3Q9vXVcaQ6SWDJgAHr4tVTXOIK+7mu87S9t0eDyfxnovd0wAJflj2D exmC4uDOgNz7qAkQFY8idDWkw7e2VwsxwF8L+hQdGKv5sTczjexoz/D2HctRy9aDFn+u /vmIpA7s2ZXlOVY2ahMc5etH06h6NCQe16kFs4KGeW/9yJD4e34SNWrSdDWSnZ2smojq H/4fI8VspmDF5eaZls8LWozymxhuCV/Z1F2vAvHBzfrIoiOlQoc3eNMfNJUj0q3D7T86 iiww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713116555; x=1713721355; h=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=JnaPpEY0rtFJVXKUk6C2w0V6eSVoJq1c6yUE/tAZODc=; b=PIrDLJHo4cqVYOWSVWSOQAMdt/ByxgIsaIJo8PMiEJ1SZeRvKKmib6mvL0+B/P9JYo incQ2D7nJFfNQ6FMHYP4HGzFf+646K72EcOnBYgbypZ7ihCQ7wYd6OFTCu3ykGzxGH8Z xvNmftTDCtrU+g9vOMmAxgH3rDX1/ulqIh80O+mOrb2+GkF9sB9htJiX2so5X8VjOp9J aBp1EEsjKP7oHoYrdeOSoJtmzXNZk/O5zKvUHAUwSuzJTLe4//GXjQ/mwfQNvCTfvTDA iSNSEKoytLZIKOX7IYAuvs0ZReeK+VHRYj/KHF0AIcfHRfpJr1EdHBcsAd8vm44vDTQ4 5Tqg== X-Gm-Message-State: AOJu0Yxg5YiQQy0oBMTfI1Iu/+iB8LRNRWRW0aowJY3Zcyw9AOb9DJ7J pymus0f9Fe8BqEtDM1QOFttXoXxR8RZGp7G7Sz4sNGjHNu1c0OABct+YXs0mHYjK3OEa7vtwHzL /fDYOlJYnVrbJVQMMC2fCfcdyiQ4= X-Google-Smtp-Source: AGHT+IH161D7TmN7Y6/Fz+emJrPCncxriKnT0SedB8LZK3Wagm6Lnjkhc4jOM9PE5vjvG1wS3ot3XSAoT++YkircZaA= X-Received: by 2002:a05:651c:11d4:b0:2d6:b98d:c868 with SMTP id z20-20020a05651c11d400b002d6b98dc868mr4916532ljo.14.1713116555196; Sun, 14 Apr 2024 10:42:35 -0700 (PDT) MIME-Version: 1.0 References: <97793422-1543-4ba6-b52b-ff93eba03ab1@eastlink.ca> <1e53a3f7-9bdb-45ae-81c7-7d0ec1a6a541@app.fastmail.com> <3cc19e86-e953-4e2f-9e57-30ff84f15fdf@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> In-Reply-To: From: "Mark J. Reed" Date: Sun, 14 Apr 2024 13:42:22 -0400 Message-ID: Subject: Re: triviality regarding $# counts To: Ray Andrews Cc: zsh-users@zsh.org Content-Type: multipart/alternative; boundary="000000000000bb403306161207dd" X-Seq: 29830 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: --000000000000bb403306161207dd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Apr 14, 2024 at 1:22=E2=80=AFPM Ray Andrews wrote: > Hard spaces will be inside ticks or $'' . > .. or double-quotes; don't forget about them. *" "*, *' '*, and *$' '* ar= e all literal spaces. It's other characters where the difference shows up. In *"*...*"*, *$*-expansions still happen; in the others, they don't. In *$'* ...*'*, ANSI C backslash escapes work; in the others, they don't. Inside *'*...*'*, absolutely everything is literal; there's not even a way to include a literal *'* in the string. One thing about the shell that makes it different from other programming languages, however, is that the quotation marks themselves are not word delimiters. So you can switch between types of quoted string... including entirely unquoted... without introducing a new shell "word". That means all of these assignments store exactly the same thing in the variable *x*: *x=3Dthis\ is\ all\ one\ word* *x=3D"this is all one word"* *x=3D'this is all one word'* *x=3D$'this is all one word'* *x=3Dthis\ 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=3D'That'\''s all, folks!'* But it's easier to just use ANSI quotes: *x=3D$'That\'s all, folks!'* --=20 Mark J. Reed --000000000000bb403306161207dd Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sun, Apr 14, 2024 at 1:22=E2=80=AFPM R= ay Andrews <rayandrews@eastlin= k.ca> wrote:
=20 =20 =20
Hard spaces will be inside ticks or $'' .=C2=A0
=C2=A0
.. or doubl= e-quotes; don't forget about them.=C2=A0 =C2=A0" ", ' ', and $' '=C2=A0are all literal spaces. It&#= 39;s other characters where the difference shows up. In "...= ", $-expansions still happen; in the others, they don't= .=C2=A0 In $'...', ANSI C backslash escapes work; in = the others, they don't.=C2=A0 Inside=C2=A0'...', = absolutely everything is literal;=C2=A0there's not even a way to includ= e a literal '=C2=A0in the string.=C2=A0

One thing about t= he shell that makes it different from other programming languages, however,= is that the quotation marks themselves are not word delimiters.=C2=A0 So y= ou can switch between types of quoted string... including entirely unquoted= ... without introducing a new shell "word".=C2=A0 That means all = of these assignments store exactly the same thing in the variable x:=

x=3Dth= is\ is\ all\ one\ word
x= =3D"this is all one word"
x=3D'this is all one word'
x=3D$'this is all one word'
x=3Dthis\ is' 'all" "= one$' 'word
The ability= to mix and match gives us the old way to get an apostrophe into an otherwi= se-single-quoted string: to close the quotes, add a backslashed=C2=A0apostr= ophe, and then go back into quotes:

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

But it's easier to just use ANSI quotes:

<= /div>
<= div>x=3D$'That\'s all, folks!'<= /font>
=C2=A0

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