Date: Wed, 19 Oct 2016 03:22:31 +1100 (EST) From: Ian Smith <smithi@nimnet.asn.au> To: "Steve O'Hara-Smith" <steve@sohara.org> Cc: freebsd-questions@freebsd.org Subject: Re: A request for cp flag Message-ID: <20161019031149.K6806@sola.nimnet.asn.au> In-Reply-To: <mailman.91.1476792002.89621.freebsd-questions@freebsd.org> References: <mailman.91.1476792002.89621.freebsd-questions@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
In freebsd-questions Digest, Vol 646, Issue 2, Message: 12 On Mon, 17 Oct 2016 19:38:41 +0100 Steve O'Hara-Smith <steve@sohara.org> wrote: > On Mon, 17 Oct 2016 15:59:10 +0100 > Matthew Seaman <matthew@FreeBSD.org> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20161019031149.K6806>