cp -n vs. test -f

Andrew P. infofarmer at gmail.com
Tue Jan 24 11:12:38 PST 2006


On 1/24/06, Scot Hetzel <swhetzel at gmail.com> wrote:
> On 1/24/06, Andrew P. <infofarmer at gmail.com> wrote:
> > So why do we use "if [ ! -f file ] ; then cp file.new file; fi"
> > instead of "cp -n file.new file" in pkg-plist's and many
> > other places? I think the "cp -n" way is what we really
> > mean to do.
> >
> We probably don't use it because of the following at the bottom of the
> cp man page.
>
> "The -v and -n options are non-standard and their use in scripts is
> not recommended."
>
> Scot
> --
> DISCLAIMER:
> No electrons were mamed while sending this message. Only slightly bruised.
>

cp manpage has this since FreeBSD 4.7-RELEASE,
can we get over it and start using it?


More information about the freebsd-ports mailing list