bug-fileutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cp -if


From: Jim Meyering
Subject: Re: cp -if
Date: Mon, 15 Jul 2002 00:16:39 +0200
User-agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.3.50 (i686-pc-linux-gnu)

Richard Dawe <address@hidden> wrote:
> JT Williams wrote:
>>
>> -: : "* cp's -f option no longer cancels the effect of --interactive (-i)
>> -: : (per POSIX)"
>> -:
>> -: Ouch. So how do we override "-i"?

There's a relatively new option just for that.
It was added in 4.1.1.  Here's the NEWS entry:

* mv and cp accept a new option: --reply={yes,no,query};  provides a consistent
    mechanism to control whether one is prompted about certain existing
    destination files.  Note that cp's and mv's -f options don't have the
    same meaning: cp's -f option no longer merely turns off `-i'.

and here's the --help entry:

      --reply={yes,no,query}   specify how to handle the prompt about an
                                 existing destination file


>> Ouch, indeed.  And why only cp?  mv -i can still be overridden.

POSIX requires that cp's -f do this and only this:

  -f, --force                  if an existing destination file cannot be
                                 opened, remove it and try again

POSIX requires that mv's -f override mv's -i.

> I don't know why it's only cp. I had a quick look at draft 7 of the Austin

In the sections for cp and mv (I search for `cp - ' and `mv - ' in d7text.txt),
it's pretty clear that the two -f options are supposed to do different things.

> Group's work, which became part of the new POSIX standard. I can't see where
> the behaviour of cp, mv is described. I've CC'd bug-fileutils. Hopefully
> someone on that list can answer your question.
...



reply via email to

[Prev in Thread] Current Thread [Next in Thread]