From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10228 invoked by alias); 25 Jun 2015 02:27:54 -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: 35599 Received: (qmail 21339 invoked from network); 25 Jun 2015 02:27:50 -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.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.0 Message-ID: <558B65EB.3060204@inlv.org> Date: Thu, 25 Jun 2015 04:22:35 +0200 From: Martijn Dekker User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Bart Schaefer , zsh-workers@zsh.org Subject: Re: '>>' does not create file if set -C (noclobber) is active References: <558B5342.2090706@inlv.org> <150624184916.ZM19079@torch.brasslantern.com> In-Reply-To: <150624184916.ZM19079@torch.brasslantern.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Bart Schaefer schreef op 25-06-15 om 03:49: > On Jun 25, 3:02am, Martijn Dekker wrote: > } > } If the 'noclobber' option (set -C) is active, the append ('>>') output > } redirection will not create a file if it doesn't exist. > } > } POSIX: > > The noclobber option is an extension, and has nothing whatsoever to do > with POSIX. It is not normally on in any emulation, so as soon as you > set it you're off in the weeds and appeal to POSIX is meaningless. That is not correct. See: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_25 -C (Uppercase C.) Prevent existing files from being overwritten by the shell's '>' redirection operator (see Redirecting Output); the ">|" redirection operator shall override this noclobber option for an individual file. [...] -o option [...] noclobber Equivalent to -C (uppercase C). Thanks, - M.