Bug 150558 - cp -f (force copy) asks for confirmation
Summary: cp -f (force copy) asks for confirmation
Alias: None
Product: Fedora
Classification: Fedora
Component: coreutils   
(Show other bugs)
Version: 3
Hardware: i686
OS: Linux
Target Milestone: ---
Assignee: Tim Waugh
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2005-03-08 11:46 UTC by Adrian
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-03-08 12:40:15 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Adrian 2005-03-08 11:46:09 UTC
Description of problem:
As root, if you run "cp -f file1 file2" and file2 exists, the command
asks for confirmation: "cp: Overwrite �file2�? (y/n)".

The "-f" option should omit the confirmation request.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. su -
2. touch file1 file2
3. cp -f file1 file2

Actual Results:  I'm asked for confirmation:
  cp: Overwrite �file2�? (y/n) 

Expected Results:  Confirmation shouldn't appear.

Additional info:

coreutils-5.2.1-31 (comes with the distribution)

There are no update available in the updates-released repository.

Comment 1 Tim Waugh 2005-03-08 12:40:15 UTC
No, that's not what the -f option is for.  Use --reply=yes to omit confirmation

Comment 2 Adrian 2005-03-08 14:14:10 UTC
Sure? I've always used -f option to avoid the question.

Running "cp --help" I obtain:
  -f, --force     borra los destinos que ya existan, sin preguntar

  -f, --force     deletes existing destinations, without asking

Maybe a recent change in the functionality of cp?

Comment 3 Tim Waugh 2005-03-08 14:40:12 UTC
Yes, I'm sure -- and if that's what cp --help really says then the
translation is incorrect.

Here is the original:

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

This is POSIX territory.  We *used* to patch cp so that -f also had
the effect that --reply=yes now does, because at the time the latter
option did not exist.

Comment 4 Adrian 2005-03-08 15:08:28 UTC
I see...
Hmmm, the new option looks a bit long:

  cp --reply=yes ...

Let me make a suggestion. What about patching cp so that -y assumes
"yes" in all questions?

  cp -y ...

The -y option is used in many commands, and I suppose it would be
useful for cp too.

Comment 5 Tim Waugh 2005-03-08 16:25:15 UTC
It's better to have fewer patches in our packages -- we already patch coreutils
heavily enough.

Feel free to suggest this on the bug-coreutils mailing list.

Note You need to log in before you can comment on or make changes to this bug.