cp -n vs. test -f

Dave Symonds dsymonds at gmail.com
Tue Jan 24 13:12:29 PST 2006

On 25/01/06, Andrew P. <infofarmer at gmail.com> wrote:
> On 1/24/06, Scot Hetzel <swhetzel at gmail.com> wrote:
> > "The -v and -n options are non-standard and their use in scripts is
> > not recommended."
> cp manpage has this since FreeBSD 4.7-RELEASE,
> can we get over it and start using it?

It's non-standard as many other OSes (Solaris for one) don't have
them. It makes the semantics a lot clearer too, since it is very
obvious that you only want to copy when the destination doesn't exist;
if you don't remember the meaning of "-n", you might guess it means
something else entirely.


More information about the freebsd-ports mailing list