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.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 5855 invoked from network); 16 Dec 2022 21:16:06 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 16 Dec 2022 21:16:06 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1671225366; b=ouJr1lFVDuPNEfL/hYJp2Cu9CWH10v53ZdTloo/e54puESyACczmLCThW5sL1mUaZIQp3MZUus yj3oCcNKZV4qJ/4+bXjZOzM2uEa2C9PEKMfb0epuZnVF9CJT0/RNDjFd5S8X93I4Q3EkM92mU0 qSL8A/LPuI4rLZ10mNMmWWdEyeTxz1ta3d6ksZRB0uHgVsMXrFVEClAqT3z+k41UUCaQkIfzGi 27FpR+n0omXff3xM1lDBl0p/eq01j2HGvsodi8zBpJATeN+z1w5BGzHqNxeA4Ie2FY3qR9dNIz 7HzcWGJ5iS7wxoVln4NQ3nrpxn6jI4JFDBnyXH8/2mwzug==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mout.gmx.net) smtp.remote-ip=212.227.15.15; dkim=pass header.d=gmx.de header.s=s31663417 header.a=rsa-sha256; dmarc=pass header.from=gmx.de; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1671225366; bh=ItVJJsiKr3cbSfpMGL80zv4vk1EyCqLLO1na2Uq+3DE=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Reply-To:Message-ID:Subject:To:From:Date: DKIM-Signature:DKIM-Signature; b=ln28X9vk8plAm4kj4C5abzJ+4yuj1l0nDKTd4zcfmlhgE09YaySyCjks7R66SEu5XpJJQ/RC4D fUwny9W1cxQZIT5dLO0nUAi1YZBWxdsaaTGsjVUHvp7KUPTTP24vTaM3nl9R8Ougc6jBfGglFn O8qDb8x6/lQ8VJxEp1cLxOchQ6dRHh+Ou0bcDbm8b6CLPNYgGSf9fgLBbTk/33niC68L5hvV9Q vF23mLldG6SCjyikDHwNI8n2LxJRkJpEtqNA/PpoqV/TKg9+qZWFelpsnuNQ+upT0/bOI2twaj 7huk779AwFzx5XJtkYi5rKvg1Zs8PX5b9707PiiIz3sf/A==; 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:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Reply-To:Message-ID:Subject:To:From: Date:Cc:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID; bh=hQklKjITCmIPNi7c/rvQMvzbZz31JoyDtuf56m9IevM=; b=ks66Shlj1CVIJFCVjB9NfLumGf NqrSf/NaZr0QyyL1VLFlVpS35gRoM8661X1FTMDdhTKfhW+TH79xKWnpoW1QFG4B4I9ILp0dvCe44 JLfJQK0qUHFL7NrkbY4Ti4xnm7/uU2m72kBglt/dJ7Oe66LOav/8s8YHcQCC61l9qcvkhacgSUP/u D2/wvrSSn08p+Si6cye78NWRrZqkL0IoImZl/fHAFQCcP4k7NbcvvEeonFHQahPmmrFugkQxpg8rQ ZQL2CIGkANAz8ZcVLB9O8TMa2n0DRAk3bTtta1BA9/QMG1dibDMioOV4sU78/5buZ7nzgWkPMfSuy MAUfqBdA==; Received: by zero.zsh.org with local id 1p6I3q-0003O6-5I; Fri, 16 Dec 2022 21:16:06 +0000 Authentication-Results: zsh.org; iprev=pass (mout.gmx.net) smtp.remote-ip=212.227.15.15; dkim=pass header.d=gmx.de header.s=s31663417 header.a=rsa-sha256; dmarc=pass header.from=gmx.de; arc=none Received: from mout.gmx.net ([212.227.15.15]:51113) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1p6I2w-0002en-2l; Fri, 16 Dec 2022 21:15:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1671225309; bh=ItVJJsiKr3cbSfpMGL80zv4vk1EyCqLLO1na2Uq+3DE=; h=X-UI-Sender-Class:Date:From:To:Subject:Reply-To:References: In-Reply-To; b=op2CSXxS6Kw8KWJ70eyg+tar8msPtBQD1+3nxzPeUH1d9qc5x28gaiCXRVjr0yefh wYk3kPKk6tFhbfGQ/O8duMynPIXEG41V7U1wVEs1a9KHvSrP/2wrFerqJZ7Ac7lysy /hNr3AXmK2sNSQbG85iJ38vZ7Yn//lx+D48SnlbrY0P5Sr1lde9YhV2eFhJjUs9v76 rPf/0c+kh+MhNrzbMf0HVVnP/X3IB1n9KLDdZOiL5FPmj4BaZdMofKC7IX98szYxh6 C7q+ARr4Qm8srb5Kh595gxsk+qEOADYQnDrytV27AhsoblvFJc6jZ8ycahVJn1qK9U x4epYXMh06vMg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from limone.obstwiese ([46.223.163.183]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MVeI2-1pVY8f1GXk-00RXiD for ; Fri, 16 Dec 2022 22:15:09 +0100 Received: from luthien by limone.obstwiese with local (Exim 4.94.2) (envelope-from ) id 1p6I2q-0003CI-La; Fri, 16 Dec 2022 22:15:04 +0100 Date: Fri, 16 Dec 2022 22:15:04 +0100 From: Dominik Vogt To: zsh-users@zsh.org Subject: Re: uninvited members of associative array Message-ID: Reply-To: dominik.vogt@gmx.de Mail-Followup-To: zsh-users@zsh.org References: <46161d8a-c177-4134-836e-592e5c048887@app.fastmail.com> <902fb047-3435-89a3-e7ea-74e74075c2c6@eastlink.ca> <09d09690-08c8-4499-9011-9c45d7676f52@app.fastmail.com> <81952d4b-3ead-f912-f987-fe9a37dbd256@eastlink.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: X-Provags-ID: V03:K1:KbNj8ui1hd2UwbDrS3jMifmqAQNePb0Pw6F6LRqLRgqjxXyFcQe ZqSIazStQvcruz13IvDepWK2rCP+ynwV/fpmRnNgXuR6GqPg+hG2j6xRPxMqgfDJXCRnKlP O3D+xH/bGVgXOE1CLAQqO8aom/YjUBeUTNs4ovAvWOUKk1oDhMQIsBLaZQj/DNakmR7e0Y3 FZBUWsNzosLFb2qRqXvVw== UI-OutboundReport: notjunk:1;M01:P0:9tINNkMuFJg=;nvI2ITN9FXd+x7SMx9lIGxqg/qH zUxounXvARN/mBGUw/xiZsNFBzWdPS45qah8bA7pV1MnmzARAcQ/KCvgqOz/l2Z5c3FLwErwK W6Dy/UBARxr0Bk6dvx0PmWvUpciWiwH7t6zGan4TckiQBAKF5fCxbcRMmdDBzh2pYjUohTsDY q0wGlRuulZS0p8DcOaMEgx33t0o6NHsB668ttWCJbJEI1RmOueoUusMDixu3VEwFbzObPM6fH YYyJ4hlWNnPTzm3GC1Wjh1ro7BFCmQAWzbY79CpW85xdO8pgBDGvGBTuz+J65IUxGwskHoWfH afCiTo6v/LrqjRx2CE35+2U4w52N/23dIEel/apmfPiCbhHURV0o8zb07TWPpgNURLWcbKXte vp86hbP03VC+iNwlSNZp9jNUyALOjwlK5xzE+rGFFa7KCE7xibaklx/DqrMamSRn3szc4j2kz kxpJcDu6qUSgNHfCYLPP/RoSrxzjm7LBnfWPBwB+TZgSu/mcZVSlFj7pkJV+9yXocMj1OeURP EKc9QmVv48a6iWdrqf6az/eAuNw6bMc2j8dE0ZOiibinoyOcU1sXIN/7l6SEalV2T+WGvO5bg DiPuxI+Iny6IKUcqf+I7VuLNOEgNhwJUhTGFMhymnZa9ci9dElg/FeH71xexzuzU9cCRNVSXL BSsrVjPLYPIWMeT4UiXtjCGz4JQ4jucgdcPPWyApW8KfmstdbhgMHiCe9U7lrmiQU8QAUBM5v LGruls6qezY7g1gJyFlFKxi9dC2xX2J+4cvyq1J8IlyxiYiQyyxGEkgVYldHIwk3cTC+HGWYZ zG1LDGksskA9jppt697EvFc2iaa5vD1MzrZIXrb34xDumnE/Ll76SPtTASE8ex80+7UtR5mMV /Zbnxxs97qq87zn/IQXX84ab4ff77Bdewnb6MXBJxOElg2ddafBWOI7kEDzoEFi7qmAaWuyJO tNO/kHZ8LdiQfurtCqi+DICvx3I= X-Seq: 28566 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, Dec 16, 2022 at 12:10:22PM -0800, Ray Andrews wrote: > > I think you have a grave misconception of shells. Shells are > > basically command line interpreters with some text processing. > I know it.=A0 All the extra functionality accreted over the years. It's = an > evolutionary cul-de-sac in that the latter additions are somewhat clumsy= in > as much as they have to contend with the earlier design.=A0 Can't be hel= ped. > > There's no > > conception of symbolic values; all input is just text. > Except for those times when I wish it is was 'just text' but instead thi= ngs > are expanded.=A0 Anyway how is a variable name not a symbol for the cont= ents > of the variable? But variables are not even a real part of the shell, the shell script or its data. Every process has an associated environment that consists of "key=3Dvalue" pairs. The parameter syntax in the shell is just a way to manipulate the environment that is then passed to the started processes. The environment exists independently of the shell. > > Shells are > > are not "programming languages". > That's a strange thing to hear.=A0 A program is a list of things on asks= a > computer to accomplish and zsh accomplishes them.=A0 But you know more a= bout > all this than I do. To begin with, the shell does not even have a fixed syntax that could be written down in a rule book: You can change the meaning of the "program" from inside the program, for example by changing options at run time or by overwriting the IFS variable, e.g. $ A=3D"a,b-c" $ echo "$A" a,b-c # fiddle with IFS $ IFS=3D"," echo "$A" a b-c # or even read value from user input $ read IFS - $ echo "$A" a,b c # fiddling with options $ X=3D(a b c d e) $ setopt ksh_arrays; echo "${#X}" 2 $ unsetopt ksh_arrays; echo "${#X}" 5 # user input defines type of parameter $ unset A $ A[foo]=3Dbar zsh: A: assignment to invalid subscript range $ read X -A $ typeset "$X" A $ A[foo]=3D"bar" $ echo "$(kv)A}" foo bar # redefine commands, aliases or even builtins $ read X ls $ alias echo=3D"$X" $ echo "Hello, world!" ls: cannot access 'Hello, world!': No such file or directory I.e. the semantics of the script may depend on user input. Then, the commands that the shell runs are mostly not defined by the shell but externally. You'd probably describe the script ls . rm -f foobarbaz as "a program that lists non-hidden entries of the current directory and then removes the entry foobarbaz if it exists and is not a directory". But that is not true. What the script really does is "execute a program 'ls' with argument '.', then execute a program 'rm' with arguments '-f' 'foobarbaz'". What the called programs do is not part of the shell. So, unless you want to define the program as a sequence of "execute X with arguments Y1 ... Yn" the shell really doesn't do anything close to what the "program" is supposed to do. =2D- Of course modern shells have lots of self contained builtin commands and control structures that resemble programming languages. Ciao Dominik ^_^ ^_^ =2D- Dominik Vogt