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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 1857 invoked from network); 31 Dec 2023 03:44:26 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 31 Dec 2023 03:44:26 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1703994266; b=ctzKBazH26Ode4yN0C1k2LZmFZRwf3MtFlrbde/+8qBwngI8WjHr2vZXcyPryTxISdWen86c6h FVWoXu3DTZEPN8hu4DSXMXMCE77gs2PzwLtAIEjC8czGudA1AZ1Eu/q43z9/9AkaT4lshwlEBY uDdDKehSz500pRNkPcMfBRRd6o9y4+CkeCTOEwD1x65n88KgsYUsn0lKMURDYvzcWsFRpQ1ZKw bgexZuNhd0uBOi4LO7sW5FK2ViQv/e6+usiw95esHHPe//4CXtkTAa4kOxohCrHfBxii74HZym qaxKgzCjyeSRwkGALeuu3qEEqaU7220uUzg/4yg3gujohw==; 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=1703994266; bh=IEgFD6Ct+zwyJxCFcxV6RZ7Vg+LBnb4VhzKqSxfDsTY=; 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=azu2pQnkyO8cZPEKmNhuKAP13BZPE5FviNB51j/4zcnwqc0WTYFf2sqfx6NdrjoF+BImVBpEEd vc/PY3+vCdSnVyzc/oTde9emX4NopoXVOR8aVfMLrDJZ86iCekmgXsLjxmeNyg4bvB0yHqSbBk q/LtIiYikUj28/btasR5EHeRXsHumAb0AxAb83vjPqGu38QDzXKjYUXvA4nsU0w2zryRfO2YjS oUvUZ9BrI9fh7vzLmN1LA5Q2ZilrxER2rCeGOMI/DRNS7jW8q0KDH+e6B8ugeptW3DxJF/nID3 LGQ83H+RkNYW3D0eHBVqiSsyLcKanaIKQggc4sN6PMpvyw==; 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=3lFUj52wjpr1ubxg+V65Clhg7FsTEi9gTq17nsPbt6s=; b=UlfqaKKM12JpQWUUkgE+0jIZIX oii/axwPunqoN7mq7ElBat1iXi8l/L9ZvGmR+MBf4ZkfEgq8vytS25P9u1ftBJVUwIWDlRMf3vBJu bvOz9pOh61KoRccgKy4NVo8TKSg8YasVEKAn5baMO66h7/OQVVpbWm6orY74GrCuCrW6UX+NsjsP1 WQFuNCtJOw5Mi/ToRggrLSuJJ2dY+5R4Eh/PJaGC8p5BgXUJxcw2lvyjT3OBgqA/sRSqe+u64xTvg c2i098gBL+9LElxjkDWPug/2MGlrKnRYfo9k2uu+wD6RmgdOQ0oIYJOOBpw66vd7Czj+kmAd29l8o JBLsLtrA==; Received: by zero.zsh.org with local id 1rJmkS-0002ub-PM; Sun, 31 Dec 2023 03:44:24 +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]:39457) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1rJmjj-0002Aq-Sc; Sun, 31 Dec 2023 03:43:40 +0000 Received: from csp02.eastlink.ca ([71.7.199.167]) by mta04.eastlink.ca ([24.224.136.10]) with ESMTPS id <0S6I0RXYWIBG0OH0@mta04.eastlink.ca> for zsh-users@zsh.org; Sat, 30 Dec 2023 23:43:38 -0400 (AST) 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 JmjhrmSeDW7C8Jmjir2c9u (version=TLSv1_2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256); Sat, 30 Dec 2023 23:43:38 -0400 X-Authority-Analysis: v=2.4 cv=CpB5MF0D c=1 sm=1 tr=0 ts=6590e36a a=e7T7DzMKK1R988ZCg0wLyw==:117 a=e7T7DzMKK1R988ZCg0wLyw==:17 a=r77TgQKjGQsHNAKrUKIA:9 a=vje04R04otj8gN0zdPMA:9 a=QEXdDO2ut3YA:10 a=pGLkceISAAAA:8 a=bja9o1Au7DWefElrb3AA:9 a=IhN5FoxOvhAKf5mD:21 a=_W_S_7VecoQA:10 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdefiedgiedvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecugfetuffvnffkpffmpdfqfgfvnecuuegrihhlohhuthemuceftddtnecunecujfgurheptgfkffggfgfuvfhfhfgjsegrtderredtvdejnecuhfhrohhmpeftrgihucetnhgurhgvfihsuceorhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrqeenucggtffrrghtthgvrhhnpefhteethfevgeeuvdelgefgvdevudefueduffdvgfelvddvgfdtieegueeuleeifeenucfkphepvdegrddvtdejrdduledrudefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvdegrddvtdejrdduledrudefpdhhvghloheplgduledvrdduieekrddtrdduudgnpdhmrghilhhfrhhomheprhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepreerpdhrtghpthhtohepiihshhdquhhsvghrshesiihshhdrohhrghdpghgvthdqkghiphfrrghsshifugepthhruhgv X-Vade-Score: 0 X-Vade-State: 0 X-EL-AUTH: rayandrews@eastlink.ca Content-type: multipart/alternative; boundary="------------EB8TzihZ9Si7uwA8XAR01SAU" Message-id: <07ddd352-0c1b-467e-9d4c-ff46020ccf41@eastlink.ca> Date: Sat, 30 Dec 2023 19:43:37 -0800 MIME-version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: zmv exits from function Content-language: en-US To: zsh-users@zsh.org References: <69024621-9e60-474f-9c32-4edaecc3ff68@eastlink.ca> From: Ray Andrews In-reply-to: X-Seq: 29392 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. --------------EB8TzihZ9Si7uwA8XAR01SAU Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2023-12-30 13:15, Mikael Magnusson wrote: > You can also do this: > { zmv '(*).SNT' '$1.eml' } always { TRY_BLOCK_ERROR=0 } Sheesh, of course I'm no expert, still I've never seen any such construction before.  Always new domains of syntax to study.  So when zmv quits, crashing out of the function is not immediate -- there is further parsing, thus this 'always' word is handled. Interesting. On 2023-12-30 12:38, Bart Schaefer wrote: > Arguably zmv could use null_glob. Thoughts from -workers? That's that option that makes everything grind to a halt if nothing if found? > No, you're thinking of nomatch, which as I said is already in effect and causing the result that you see. The null_glob option supersedes no_match and makes globs that don't match anything disappear without an error. Yeah, for some unknown reason I said it backwards -- I know that (N) smooths continuation of flow, it doesn't break it. > This is in contrast to the no_nomatch option which leaves the glob un-expanded but does not remove it. I've run into that, and it can be ugly -- literal asterisks being fed to some command that doesn't want them. It's good to understand what's going down there. Setting null_glob globally can be dangerous because it can leave a command with no arguments at all or with its arguments in a different order than expected. Yes, another potential landmine. What might be intuitive is some way of simply making a command 'stop', but that might not be so simple -- something that holds it's place, but has no value -- it 'counts' as an argument but has no content. It's so dumb when: "ls no-such-files.*" ends up listing everything in the directory rather than nothing. Dunno who thought that was a good idea. > zmv -n '(*/)#(*).(SNT|MES)' '$1$2.eml' If that looks like it would do the right thing, remove the "-n". I'll give it a go. So much can be done with all that globbing functionality. Such power. But I can never remember that tersest of all terse syntaxes -- gotta make myself a cheat sheet including a page full of examples. --------------EB8TzihZ9Si7uwA8XAR01SAU Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit


On 2023-12-30 13:15, Mikael Magnusson wrote:
You can also do this:
  { zmv '(*).SNT' '$1.eml' } always { TRY_BLOCK_ERROR=0 }

Sheesh, of course I'm no expert, still I've never seen any such construction before.  Always new domains of syntax to study.  So when zmv quits, crashing out of the function is not immediate -- there is further parsing, thus this 'always' word is handled.  Interesting.

On 2023-12-30 12:38, Bart Schaefer wrote:
Arguably zmv could use null_glob.  Thoughts from -workers?
That's that option that makes everything grind to a halt if nothing if found?
> No, you're thinking of nomatch, which as I said is already in effect
and causing the result that you see.  The null_glob option supersedes
no_match and makes globs that don't match anything disappear without
an error.  

Yeah, for some unknown reason I said it backwards -- I know that (N) smooths continuation of flow, it doesn't break it.  

> This is in contrast to the no_nomatch option which leaves
the glob un-expanded but does not remove it.

I've run into that, and it can be ugly -- literal asterisks being fed to some command that doesn't want them.  It's good to understand what's going down there.

  Setting null_glob
globally can be dangerous because it can leave a command with no
arguments at all or with its arguments in a different order than
expected.

Yes, another potential landmine.  What might be intuitive is some way of simply making a command 'stop', but that might not be so simple -- something that holds it's place, but has no value -- it 'counts' as an argument but has no content.  It's so dumb when: "ls no-such-files.*" ends up listing everything in the directory rather than nothing.  Dunno who thought that was a good idea.  


>  zmv -n '(*/)#(*).(SNT|MES)' '$1$2.eml'

If that looks like it would do the right thing, remove the "-n".

I'll give it a go.  So much can be done with all that globbing functionality.  Such power.  But I can never remember that tersest of all terse syntaxes -- gotta make myself a cheat sheet including a page full of examples.


 

--------------EB8TzihZ9Si7uwA8XAR01SAU--