Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Jan 2006 12:26:55 -0600
From:      Scot Hetzel <swhetzel@gmail.com>
To:        "Andrew P." <infofarmer@gmail.com>
Cc:        FreeBSD Ports <ports@freebsd.org>
Subject:   Re: cp -n vs. test -f
Message-ID:  <790a9fff0601241026s3f4e7f09k92ab1de2cd974b5d@mail.gmail.com>
In-Reply-To: <cb5206420601240941r16ad7ed7x8ab50c40fee86e2b@mail.gmail.com>
References:  <cb5206420601240941r16ad7ed7x8ab50c40fee86e2b@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 1/24/06, Andrew P. <infofarmer@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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?790a9fff0601241026s3f4e7f09k92ab1de2cd974b5d>