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=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 30752 invoked from network); 3 Jun 2020 02:09:12 -0000 Received: from ns1.primenet.com.au (HELO primenet.com.au) (203.24.36.2) by inbox.vuxu.org with ESMTPUTF8; 3 Jun 2020 02:09:12 -0000 Received: (qmail 24289 invoked by alias); 3 Jun 2020 02:09:02 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 45952 Received: (qmail 17026 invoked by uid 1010); 3 Jun 2020 02:09:02 -0000 X-Qmail-Scanner-Diagnostics: from wout5-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.3/25828. spamassassin: 3.4.4. Clear:RC:0(64.147.123.21):SA:0(-2.7/5.0):. Processed in 1.05263 secs); 03 Jun 2020 02:09:02 -0000 X-Envelope-From: martin@arp242.net X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at spf.messagingengine.com designates 64.147.123.21 as permitted sender) X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudefkedggeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfffhffvufgtsehttdertd erredtnecuhfhrohhmpedfofgrrhhtihhnucfvohhurhhnohhijhdfuceomhgrrhhtihhn segrrhhpvdegvddrnhgvtheqnecuggftrfgrthhtvghrnhepvddvledvvdejiefgvdevgf evtdegheevkeejtedtieejtdffteeuveduteeiieefnecuvehluhhsthgvrhfuihiivgep tdenucfrrghrrghmpehmrghilhhfrhhomhepmhgrrhhtihhnsegrrhhpvdegvddrnhgvth X-ME-Proxy: X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.3.0-dev0-519-g0f677ba-fm-20200601.001-g0f677ba6 Mime-Version: 1.0 Message-Id: <89aed74d-db7b-47ad-b218-8158838049e9@www.fastmail.com> Date: Wed, 03 Jun 2020 10:08:27 +0800 From: "Martin Tournoij" To: zsh-workers@zsh.org Subject: Any way to allow clobbering empty files when noclobber is set? Content-Type: text/plain Hi there, I switched from tcsh to zsh a while ago (many years too late, I know), and found zsh can do pretty much everything better. There's one thing I rather miss though: the 'notempty' option in 'noclobber'. To quote tcsh(1): > If the shell variable noclobber is set, then the file must not exist or be > a character special file [...] If notempty is given in noclobber, `>' is > allowed on empty files; if ask is set, an interacive confirmation is > presented, rather than an error. 1. Is there any way to do this in zsh (especially the notempty option)? I know you can use >! to override it, but empty files are rarely important so just allowing them to be clobbered seems better UX in most cases. I can't find anything in zshall(1) or the interwebz. 2. Assuming the answer to 1) is "no", would any patches be accepted to add a setting for this? I rather miss this behaviour (I actually added these settings to tcsh a few years ago). For context, the most common case (for me, anyway) is when I accidentally create a file with a failing command: $ cmd -wrong-flag > foo stderr: you made a mistake # Oops, we used a wrong flag, let's correct it: $ cmd -correct-flag > foo zsh: file exists: foo # Ah, an empty file still got created >_< Need to remove it first, or # replace > with >! $ rm foo $ cmd -correct arg > foo Thanks, Martin P.S. The emailing list software told me to email zsh-workers-faq@zsh.org for a FAQ about this list, which is what I did and it came back with: > FAQ - Frequently asked questions of the zsh-workers@zsh.org list. > > None available yet. Maybe remove that part from the template, as there is no FAQ?