From owner-freebsd-questions@freebsd.org Tue Oct 18 16:22:36 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A451BC16BA3 for ; Tue, 18 Oct 2016 16:22:36 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Received: from sola.nimnet.asn.au (paqi.nimnet.asn.au [115.70.110.159]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23E62202 for ; Tue, 18 Oct 2016 16:22:35 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Received: from localhost (localhost [127.0.0.1]) by sola.nimnet.asn.au (8.14.2/8.14.2) with ESMTP id u9IGMVO3005292; Wed, 19 Oct 2016 03:22:31 +1100 (EST) (envelope-from smithi@nimnet.asn.au) Date: Wed, 19 Oct 2016 03:22:31 +1100 (EST) From: Ian Smith To: "Steve O'Hara-Smith" cc: freebsd-questions@freebsd.org Subject: Re: A request for cp flag In-Reply-To: Message-ID: <20161019031149.K6806@sola.nimnet.asn.au> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 16:22:36 -0000 In freebsd-questions Digest, Vol 646, Issue 2, Message: 12 On Mon, 17 Oct 2016 19:38:41 +0100 Steve O'Hara-Smith wrote: > On Mon, 17 Oct 2016 15:59:10 +0100 > Matthew Seaman wrote: > > > You're not going to get anyone to change the behaviour of a core command > > like cp(1) I'm afraid. For all that you dislike the behaviour when > > copying a directory path that ends in '/' there will be many, many more > > people that have written scripts that depend on that exact behaviour and > > will be exceedingly peeved if those scripts stop working. > > Adding a -r flag wouldn't break anything at least until POSIX adds > one that does something else and then there'd be a decision to make, for > that reason I doubt anyone would entertain a new single letter option to cp. Not to pick on you in particular, Steve, but it seems nobody's noticed that FreeBSD cp(1) already supports an -r flag, albeit with deprecation. COMPATIBILITY Historic versions of the cp utility had a -r option. This implementation supports that option, however, its behavior is different from historical FreeBSD behavior. Use of this option is strongly discouraged as the behavior is implementation-dependent. In FreeBSD, -r is a synonym for -RL and works the same unless modified by other flags. Historical implementations of -r differ as they copy special files as normal files while recreating a hierarchy. cheers, Ian