zsh-workers
 help / color / mirror / code / Atom feed
From: Stephane Chazelas <stephane.chazelas@gmail.com>
To: zsh-workers@zsh.org
Subject: Re: '>>' does not create file if set -C (noclobber) is active
Date: Thu, 25 Jun 2015 15:04:32 +0100	[thread overview]
Message-ID: <20150625140432.GD19558@chaz.gmail.com> (raw)
In-Reply-To: <150625003047.ZM19218@torch.brasslantern.com>

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


  reply	other threads:[~2015-06-25 14:05 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-25  1:02 Martijn Dekker
2015-06-25  1:49 ` Bart Schaefer
2015-06-25  2:22   ` Martijn Dekker
2015-06-25  7:30     ` Bart Schaefer
2015-06-25 14:04       ` Stephane Chazelas [this message]
2015-06-25 16:00         ` Bart Schaefer
2015-06-25 19:20           ` Chet Ramey
2015-06-26 14:14       ` Martijn Dekker
2015-06-26 20:15         ` Bart Schaefer
2015-06-27  1:54           ` Martijn Dekker
2015-06-27  3:38             ` Bart Schaefer
2015-06-27 17:02         ` Peter Stephenson
2015-06-28  0:02           ` Martijn Dekker
2015-06-28  0:46             ` Martijn Dekker
2015-06-28  7:48             ` Stephane Chazelas
2015-06-28  9:15               ` Oliver Kiddle
2015-06-28 14:00                 ` Stephane Chazelas
2015-06-28 18:38                   ` Bart Schaefer
2015-06-28 19:30                     ` Stephane Chazelas
2015-07-23  2:56                     ` PATCH: sysopen (was Re: '>>' does not create file if set -C (noclobber) is active) Oliver Kiddle
2015-07-24 10:57                       ` Peter Stephenson
2015-07-24 11:55                         ` Peter Stephenson
2015-07-30 11:05                           ` Mikael Magnusson
2015-07-31 12:41                         ` Oliver Kiddle
2015-07-31 14:02                           ` Mikael Magnusson
2015-06-28 17:19             ` '>>' does not create file if set -C (noclobber) is active Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150625140432.GD19558@chaz.gmail.com \
    --to=stephane.chazelas@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).