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.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 26244 invoked from network); 5 Dec 2022 14:12:59 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 5 Dec 2022 14:12:59 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1670249579; b=swA9zDkMqbJ2wpuIdFZ9++f6LuWIP5TiHmMTILiPixAG0Pa5l7+JlGVOyNGGxGarj8L74ZzbJX qmrZ5Ou+iR4vzbAzgX10qIc7XHI+Fzsent1kZWTkIRmJ0djOgreeYyi8LN8T/UhJClF8NuvMic QdYefYzVsVZ21dAVkP7W49AFOpI41COezk7q2oW1hvLGsD6l1S2Wo5EvVfS7BIMm5QYM8js2MG wkyC9YJV1pTIjoWRi1hQeBnnd6CXOUA0oCXa9KUFvo7LSjKPrSGX21XUFT/9zGyMdiEWmJDwDg QXuHMWbWjSBvwyhNvkfkwIlCClUxHA2YnW8uErycsMpGkg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mta04.eastlink.ca) smtp.remote-ip=24.224.136.10; 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=1670249579; bh=An7DRwOCZR81IiPYLz3/G9yEBH16KMloQz3plcRCsic=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:To:Subject:MIME-Version:Date:Message-ID:DKIM-Signature; b=bx8LZDQlLDnDGzUZ6S4qNFBmpVkavZu6rET+EAm6qySd6CKB83kfdh67x6OdQVSckcd4CwGl80 1M3feCIZxVWKbnlIgeVVU2lc9DGl5OKpXCDi/40leUN9jz4NxODmDlQPyWrGf94j7x5tIcFx3k qvg0Za7DNNcnPqq+Ogw2ysJjC31u9byu2rBYsVAivckZrsvVlr3vJdyvzH9WS9k09UOwEPa1// Dm8ZhZSDPBZolMvd0QWxgQyfbv7gPJOMvCHtK9ZQze+8S8S1K8aZuEwkDyR+W1uK+ke2RvKpH5 6KCF5mHJnEyE2PQQgLkS1jtTDGasNEbK9YjgeWGATsyDnw==; 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:In-reply-to:From:References:To:Subject: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; bh=JZgn8OB7cRbbGBXFppe6AvaSzzS6hEQ/MeJPjRhXKlA=; b=g6Xt30j2KuvFn6fwd6hxNPVbZP ttNAlxaiVMTPYL1+JzpdUv5AthD9EBcgcry/QYT0hn5/8gPPDITmCajFuFBiGR9LKnEC/WQy1M7T2 9+xOsApx1q9deHZYCvv1Yxgasw7Yv/NBRQ+MY+E8wvC8DyS+dnFel6L8CewIyePIjrbKntBYRLnRa DX4iU5ZE8O6GaEqQMeowtWB9HhdizvjA1gszoAt0H0zokG2CBn2cmRcdaCqtcxGMtY/qvQZ7bw/ur ZbuNOyx3m7bQ7UHZEorDK5nz/QBzFZxunMVgwCYqWQkWUPhLMq2/1ccAugf2Tsmk2F8eO0WMnnadE YOJrmecg==; Received: by zero.zsh.org with local id 1p2CDJ-0006nT-3z; Mon, 05 Dec 2022 14:12:57 +0000 Authentication-Results: zsh.org; iprev=pass (mta04.eastlink.ca) smtp.remote-ip=24.224.136.10; dmarc=none header.from=eastlink.ca; arc=none Received: from mta04.eastlink.ca ([24.224.136.10]:53471) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) id 1p2CCK-00067Y-O8; Mon, 05 Dec 2022 14:11:57 +0000 Received: from csp02.eastlink.ca ([71.7.199.167]) by mta04.eastlink.ca (Oracle Communications Messaging Server 8.0.2.2.20180531 64bit (built May 31 2018)) with ESMTPS id <0RMF0079Y8P6ATM0@mta04.eastlink.ca> for zsh-users@zsh.org; Mon, 05 Dec 2022 10:11:54 -0400 (AST) Received: from [192.168.0.4] ([24.207.18.108]) by Eastlink with ESMTPSA id 2CCHpeimyeLAh2CCIpTBvB; Mon, 05 Dec 2022 10:11:54 -0400 X-Authority-Analysis: v=2.4 cv=S7gfgqgP c=1 sm=1 tr=0 ts=638dfc2a a=xN66ZtSbq5jdJYpBp7G/jQ==:117 a=xN66ZtSbq5jdJYpBp7G/jQ==:17 a=IkcTkHD0fZMA:10 a=y3ZzZCfOAzDlohV5CzkA:9 a=QEXdDO2ut3YA:10 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudeggdeiudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfgtefuvffnkffpmfdpqfgfvfenuceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeftrgihucetnhgurhgvfihsuceorhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrqeenucggtffrrghtthgvrhhnpeeitdejffevgfdtheeggfetkeeugeegieetuddtvddvudetteffvdevlefgueekudenucfkphepvdegrddvtdejrddukedruddtkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvgedrvddtjedrudekrddutdekpdhhvghloheplgduledvrdduieekrddtrdegngdpmhgrihhlfhhrohhmpehrrgihrghnughrvgifshesvggrshhtlhhinhhkrdgtrgdpnhgspghrtghpthhtohepvddprhgtphhtthhopeerredprhgtphhtthhopeiishhhqdhushgvrhhsseiishhhrdhorhhgpdhgvghtqdgkihhprfgrshhsfigupehtrhhuvg X-Vade-Score: 0 X-Vade-State: 0 X-EL-AUTH: rayandrews@eastlink.ca Message-id: <1a9012ef-7bac-aae8-8a7c-5b8aa86b4cfa@eastlink.ca> Date: Mon, 5 Dec 2022 06:11:53 -0800 MIME-version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: trivial question To: zsh-users@zsh.org References: <9d81fc7d-aa60-9b6a-47df-6fc677b933f9@eastlink.ca> <63ae2364-1bba-405d-a1e6-4813df512340@app.fastmail.com> <8fc6bf49-3463-4432-b706-15b49d19a9b5@app.fastmail.com> Content-language: en-US From: Ray Andrews In-reply-to: <8fc6bf49-3463-4432-b706-15b49d19a9b5@app.fastmail.com> Content-type: text/plain; charset=UTF-8; format=flowed Content-transfer-encoding: 8bit X-Seq: 28480 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 2022-12-04 22:40, Lawrence Velázquez wrote: > It's common enough to forget (or not know) that globs support bracket > expressions. It's one of those gotchas that baffle the apprentice.  In practice I'd not leave the string unquoted, but  I'm glad to have my curiosity satisfied as to what's going on when it's unquoted. Good example of the 'always quote' maxim in action.  Unless of course you have some specific reason to do otherwise.  I need a better gut understanding of when zsh is going to attempt one of these filename generations, it's naively 'obvious' that 'echo var[2]' is a command to echo a string not look for a filename. With variables of course it's explicit with the dollar sign that one is requesting an expansion, but with files it's up to zsh when and where it wants a string to be a string and when it wants it to be a filename glob.  I myself would have made that explicit too. Then again, the shells started out processing filenames not strings, so it's understandable that things are as they are.  As I said it's a point of curiosity not practical difficulty. > That was a demonstration of behavior, not a suggestion to disable And taken as such. You really need to get out of the habit of enabling/disabling options > that you don't understand just because one of us explains how they > change some behavior or other. You did the same thing with ERR_EXIT > in users/28432, and it was equally misguided. > > The correct remedy here, as usual, is to quote properly, not fiddle > with options. I experiment with things, that's all.  One can take it on faith that ERR_EXIT is a bad idea, but when one watches it nuke a terminal one knows first hand that it's a bad idea.  It's much easier to remember from experience than by rote.  The nice thing about software is that one can experiment quite wildly without really doing any harm that a restart won't fix.  Obviously there are limitations to that, but still one has considerable latitude. It has always driven my teachers mad, but I learn by breaking things.  I like to Know with a kapital K.  Thanks for the demo code, that's a master class.