From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2427 invoked by alias); 25 Jun 2015 14:05:30 -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: X-Seq: 35602 Received: (qmail 18195 invoked from network); 25 Jun 2015 14:05:25 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: * X-Spam-Status: No, score=1.0 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,FSL_HELO_BARE_IP_2,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW, RCVD_NUMERIC_HELO,SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.0 X-Injected-Via-Gmane: http://gmane.org/ To: zsh-workers@zsh.org From: Stephane Chazelas Subject: Re: '>>' does not create file if set -C (noclobber) is active Date: Thu, 25 Jun 2015 15:04:32 +0100 Message-ID: <20150625140432.GD19558@chaz.gmail.com> References: <558B5342.2090706@inlv.org> <150624184916.ZM19079@torch.brasslantern.com> <558B65EB.3060204@inlv.org> <150625003047.ZM19218@torch.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 2.217.126.102 Content-Disposition: inline In-Reply-To: <150625003047.ZM19218@torch.brasslantern.com> User-Agent: Mutt/1.5.21 (2010-09-15) 2015-06-25 00:30:47 -0700, Bart Schaefer: > On Jun 25, 4:22am, Martijn Dekker wrote: > } Subject: Re: '>>' does not create file if set -C (noclobber) is active > } > } > The noclobber option is an extension, and has nothing whatsoever to do > } > with POSIX. > } > } That is not correct. > > Well, damn. When did they do that? > > As far as I know, this was first implemented in zsh and has worked as it > does in zsh since around 1990 -- there is no mention of the -C option in > the ksh88 manual, for example. So I'm still inclined to say that this > is just not going to change, because we'd either have to (1) change it in > native mode or (2) do one of those hacks that tests the emulation mode > so it only works if you actually start the shell that way or (3) add an > entirely new setopt just for this. I don't like any of those choices. Though that's initially a csh feature (from the start: 1979), AFAIK, noclobber has always been in ksh. But the -C alias may have been added in ksh93 and retrofitted to ksh88. The ksh88a (http://www.in-ulm.de/~mascheck/various/shells/ksh88-fixes) release notes mention noclobber. The ksh93 release notes mention adding -C as an alias for noclobber. The original pdksh didn't have either. I don't know when they were added. It was added to bash in January 1990 but first as a variable. 1.12 (Dec 1991) had it as both set -C and set -o noclobber. I suspect both were already in POSIX.2. It was added to ash in 4.4BSD-Alpha (1992): http://www.in-ulm.de/~mascheck/various/ash/index.html#44bsdalpha I don't think it was ever added to the Bourne shell though. -- Stephane