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, HTML_MESSAGE,MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 29877 invoked from network); 6 Dec 2022 15:29:25 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 6 Dec 2022 15:29:25 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1670340565; b=UsclKp3KxuNlK/5x3UBQKmKbM50O9ivfpWOsgqD7zWcUhnwikIZUw4USgJHJw3SvBgSzP9kqHD kwlkboMF0fFgIHsI/j5C15vHOCemZQpkx0F4/FPfEGXM4l85YOSoNR7aSiuT+M3jJloB4ICPfw U0zH9OJHoHqshHPcev8Ta6/fzZ7CcVYad8GGNSrq8p/nVwxrVFdTl5aE+JtcD8y0zJLgYIziI2 nOLpaU0c/IBwziB5fUZFOGnCtWnFx1rbagji19xuQJmpgARDNiiNK2OuAQnQkzXxcqLlwP/yJT BFrTX36ZPRTi5afRpAslhmg2V36Vk5G8KtjM+4WoAW756Q==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mta02.eastlink.ca) smtp.remote-ip=24.224.136.13; 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=1670340565; bh=oPMcspwl0gbHZQcczmgpHkE8jE0SlXEJH09gmz58qzo=; 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=CRpxi/RK369lE+oproVlNJg68hQ5UIItb6PsA6oO8vikSbYZcmhweptDL4p2/b60qavpUz736U 7MF4sLk9MTvMp9peouJCsiY5n1D/3hHFAReMPeo+aKQSIwsaFHVaBpc5NNY7OHZEu8mjJ+Wy4G oTQ1JqztNwWkULFNlU7m9ua0i8NXf+TBZI+KHYMlIFIRY3cvqi7Lu+/cB96xnaKfYjP3ESCmw3 qMP1H0t7rc+AEm+sPPhwl7AmldU4/pt8mAOIyvY+KbmWkCLvxOVyi6tvB4gRVCHVkvwsbykBWR gX/P2IG7gl7+UzHLc+lyxjrQu2TxlRYk6Q+8xCn0wOOAHg==; 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=jJeZ6NJcAVM9bt198MjPyMXEoqFedi21dz6e8taOvXM=; b=XtCQuSpaqKIWUY03TyDCJHl1NP YDr2q5qHxZT8GEcciUTqE4yf/CzRICHoDgujN4VvIYK+j9sSylj1AH+vNR7JWbt5YV8R2hKabfqqh /HeX67JdwlRNBoTWZS8VhQcoQ0Jp8411YovbuT0hmBriP7t2U+sYlGwIfBUIIPglx9oG4AaKUZTku yRtCc+ozOgwwTt7rMtRF5qd8oEfTHJO4F0o3b9WkKFEmgXIGdSZuIDlM/rmxdM++8LxPlce82L+z5 /DUJKZJXJHeLJKdIRv1/WG26/Prjqpm7LY23pWkC0cUSn4bRiz50r3YUk0XAuH2iu37ogUkhCUitd lZ6Hh4oA==; Received: by zero.zsh.org with local id 1p2Zsq-000Ned-Uc; Tue, 06 Dec 2022 15:29:24 +0000 Authentication-Results: zsh.org; iprev=pass (mta02.eastlink.ca) smtp.remote-ip=24.224.136.13; dmarc=none header.from=eastlink.ca; arc=none Received: from mta02.eastlink.ca ([24.224.136.13]:43257) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) id 1p2Zrz-000Mxa-85; Tue, 06 Dec 2022 15:28:34 +0000 Received: from csp01.eastlink.ca ([71.7.199.166]) by mta02.eastlink.ca (Oracle Communications Messaging Server 8.0.2.2.20180531 64bit (built May 31 2018)) with ESMTPS id <0RMH005YW61TN3P0@mta02.eastlink.ca> for zsh-users@zsh.org; Tue, 06 Dec 2022 11:28:29 -0400 (AST) Received: from [192.168.0.4] ([24.207.18.108]) by Eastlink with ESMTPSA id 2Zrwp8wQdEN8v2Zrwpdw0w; Tue, 06 Dec 2022 11:28:29 -0400 X-Authority-Analysis: v=2.4 cv=IPDESCjG c=1 sm=1 tr=0 ts=638f5f9d a=xN66ZtSbq5jdJYpBp7G/jQ==:117 a=xN66ZtSbq5jdJYpBp7G/jQ==:17 a=r77TgQKjGQsHNAKrUKIA:9 a=_TRuaCDerDp2faz_4YMA:9 a=QEXdDO2ut3YA:10 a=pGLkceISAAAA:8 a=N6ErgLXWzQEvd42-IXAA:9 a=KX--_A1MMBYYXuEG:21 a=_W_S_7VecoQA:10 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudeigdejjecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfgtefuvffnkffpmfdpqfgfvfenuceurghilhhouhhtmecufedttdenucenucfjughrpegtkfffgggfuffvfhfhjgesrgdtreertdefjeenucfhrhhomheptfgrhicutehnughrvgifshcuoehrrgihrghnughrvgifshesvggrshhtlhhinhhkrdgtrgeqnecuggftrfgrthhtvghrnhepgfdtvdduheevuefhvedtgfeuteefvdfhtdehleethfeiudelueekjeejfffhhefgnecukfhppedvgedrvddtjedrudekrddutdeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvdegrddvtdejrddukedruddtkedphhgvlhhopegludelvddrudeikedrtddrgegnpdhmrghilhhfrhhomheprhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepreerpdhrtghpthhtohepiihshhdquhhsvghrshesiihshhdrohhrghdpghgvthdqkghiphfrrghsshifugepthhruhgv X-Vade-Score: 0 X-Vade-State: 0 X-EL-AUTH: rayandrews@eastlink.ca Content-type: multipart/alternative; boundary="------------2706vG3a6BvYmH88WXLgQvWD" Message-id: <9210d692-ed2c-c853-a5bb-23d9d6a097b2@eastlink.ca> Date: Tue, 6 Dec 2022 07:28:28 -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 Content-language: en-US 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> <1a9012ef-7bac-aae8-8a7c-5b8aa86b4cfa@eastlink.ca> From: Ray Andrews In-reply-to: X-Seq: 28506 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. --------------2706vG3a6BvYmH88WXLgQvWD Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2022-12-05 20:29, Bart Schaefer wrote: > > If you're asking what else are glob characters, you should probably > attempt to understand the corresponding manual section. > If a word contains an unquoted instance of one of the characters ‘*’, ‘(’, ‘|’, ‘<’, ‘[’, or ‘?’, it is regarded as a pattern for filename generation, unless the GLOB option is unset. If the EXTENDED_GLOB option is set, the ‘^’ and ‘#’ characters also denote a pattern; otherwise they are not treated specially by the shell. What overloads me is the way pattern globbing (do we say that? or just call it 'pattern matching'?) and filename globbing are conflated in there.  So very similar but so subtly different. Anyway stuff is starting to stick to the inside of my skull.   At the very least I know where to expect trouble.  Obviously it's decades late to complain about any of this, but life would be simpler if it was explicit that one wanted to generate filenames or one wanted strings to be strings.  That way there'd be no need for a list of special characters. I know that echo doesn't decide how it's arguments will be handled, still it's intuitive that one echos a string.  But I suppose the rule is to quote anything you want to be immune to such expansions and it's as simple as that. Unquote and you're taking your chances.  Fair enough.  It's an early lesson. Lawrence: > You can observe this with XTRACE: Gotta spend more time with that. Output can be a bit overwhelming but slow and steady -- the information is in there. A better tool is "typeset -p", which outputs an accurate (albeit sometimes difficult-to-read) representation. % typeset -p arr typeset -a arr=( $'a\nb\C-Mc' $'d\C-Me\nf' ) Yes! It almost doesn't matter that it's hard to read, the point is to catch that one is not the same as the other. Yup, that's a life-lesson. Peter: There's the special case of the GLOB_ASSIGN option where all assignments, not just arrays, undergo globbing. That's for compatibility with early versions of zsh, otherwise it's very confusing. Deus absit. What I might like is some way of turning it all off. Like unsetopt glob, yes? Actually, tho it started out as a purely academic question, I can now think of a place where I think I'll want to do that. --------------2706vG3a6BvYmH88WXLgQvWD Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit


On 2022-12-05 20:29, Bart Schaefer wrote:

If you're asking what else are glob characters, you should probably
attempt to understand the corresponding manual section.

If a word contains an unquoted instance of one of the characters ‘*’, ‘(’, ‘|’, ‘<’, ‘[’, or ‘?’, it is regarded as a pattern for filename generation, unless the GLOB option is unset. If the EXTENDED_GLOB option is set, the ‘^’ and ‘#’ characters also denote a pattern; otherwise they are not treated specially by the shell.

What overloads me is the way pattern globbing (do we say that? or just call it 'pattern matching'?) and filename globbing are conflated in there.  So very similar but so subtly different.  Anyway stuff is starting to stick to the inside of my skull.   At the very least I know where to expect trouble.  Obviously it's decades late to complain about any of this, but life would be simpler if it was explicit that one wanted to generate filenames or one wanted strings to be strings.  That way there'd be no need for a list of special characters. I know that echo doesn't decide how it's arguments will be handled, still it's intuitive that one echos a string.  But I suppose the rule is to quote anything you want to be immune to such expansions and it's as simple as that.  Unquote and you're taking your chances.  Fair enough.  It's an early lesson. 

Lawrence:

> You can observe this with XTRACE:

Gotta spend more time with that.  Output can be a bit overwhelming but slow and steady -- the information is in there.
A better tool is "typeset -p", which outputs an accurate (albeit
sometimes difficult-to-read) representation.

	% typeset -p arr
	typeset -a arr=( $'a\nb\C-Mc' $'d\C-Me\nf' )

Yes! It almost doesn't matter that it's hard to read, the point is to catch that one is not the same as the other.  Yup, that's a life-lesson.

Peter:

There's the special case of the GLOB_ASSIGN option where all
assignments, not just arrays, undergo globbing.  That's for
compatibility with early versions of zsh, otherwise it's very
confusing.

Deus absit.  What I might like is some way of turning it all off.  Like unsetopt glob, yes?  Actually, tho it started out as a purely academic question, I can now think of a place where I think I'll want to do that.



--------------2706vG3a6BvYmH88WXLgQvWD--