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 22148 invoked from network); 4 Jun 2020 02:44:02 -0000 Received: from ns1.primenet.com.au (HELO primenet.com.au) (203.24.36.2) by inbox.vuxu.org with ESMTPUTF8; 4 Jun 2020 02:44:02 -0000 Received: (qmail 16248 invoked by alias); 4 Jun 2020 02:43:56 -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: 45959 Received: (qmail 23979 invoked by uid 1010); 4 Jun 2020 02:43:56 -0000 X-Qmail-Scanner-Diagnostics: from mail-ot1-f51.google.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(209.85.210.51):SA:0(-1.9/5.0):. Processed in 0.966933 secs); 04 Jun 2020 02:43:56 -0000 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.210.51 as permitted sender) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=KoaLAhOK5W119pNE8Ko/6AzImYwxF19WehF5m1AZnVw=; b=ia4KQLaUb1hxR0i9ucjjeWWHwOQFzG5FlCzY7EmLDory8VLD/m6ZCzKRUeP89CXGyO tO6AUyKaDVgQ54co0CJJDeaMhtOZh+fEVFSaLy3P2huMviPQWBzHeVTIFggADWUGp9KL hEh06qD3H6Nfv54m0D+Sv2tAvoSlr1ltKCe4ey4xZfDoUp2PiUEUMQQdtYmg42y4uEh5 9k/QBMZBa48BUymnMMyaK7DlWKYndYMzkcoGnDFL15KsT5JBpUdKJfS7vQuvdi0cLZfe qe5/lA/iCyTl/HoD3EVQ8Y/GUQ/5k65ijI4zJKqrk7qvdq/E6fI9Hjr+BAqQtWeMM3mP jg5Q== X-Gm-Message-State: AOAM531sZ6kZNzi53HgqdtsMBHm8BIhA1KoJbbgDRJL+8DWhOIesJlXN MsMs4Oc+9O1HXGD6RcPIL7VTsYDjZnOWSRV/IVFSjMQURCU= X-Google-Smtp-Source: ABdhPJw2F3cKCGGYlHr4xwYXGu0IiKNwbba+kimBCoAEg4VzZV2RKJTk6NvT53Y9igdy752PYQgEMo2E/0kT/hVn9ZU= X-Received: by 2002:a9d:7e8e:: with SMTP id m14mr2270518otp.229.1591238602660; Wed, 03 Jun 2020 19:43:22 -0700 (PDT) MIME-Version: 1.0 References: <89aed74d-db7b-47ad-b218-8158838049e9@www.fastmail.com> <94e73ebcf39d4d3f9c7ae257b1d75d16@CAMSVWEXC01.scsc.local> <20200604014850.52d241bd@tarpaulin.shahaf.local2> In-Reply-To: <20200604014850.52d241bd@tarpaulin.shahaf.local2> From: Bart Schaefer Date: Wed, 3 Jun 2020 19:43:11 -0700 Message-ID: Subject: Re: Any way to allow clobbering empty files when noclobber is set? To: "zsh-workers@zsh.org" Cc: Martin Tournoij Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Jun 3, 2020 at 6:49 PM Daniel Shahaf wrote= : > > I certainly have several cases in my $HISTFILE where I repeated > a command with =C2=AB>=C2=BB changed to =C2=AB>!=C2=BB,=C2=B9 in the patt= ern Martin described. Are you sure you haven't set the HIST_ALLOW_CLOBBER option? > ... thinking out loud, how about an > option that does the following: > > Given =C2=ABfoo > bar=C2=BB, if =C2=ABfoo=C2=BB was run and exited no= n-zero and > NO_CLOBBER in effect [which implies that =C2=ABbar=C2=BB didn't exist= before > foo was run], check whether =C2=ABbar=C2=BB is zero-size and, if so, = unlink it. How does that user experience differ from HIST_ALLOW_CLOBBER? In either of those cases, you have to retrieve the command from history and execute it again ... and silently unlinking a file is not very friendly. The /etc/nologin example in your next message comes to mind.