Bug 213185 - mv --reply=no not working
mv --reply=no not working
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: coreutils (Show other bugs)
4.2
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-10-30 22:08 EST by Christopher Palmer
Modified: 2007-11-16 20:14 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-10-31 06:07:40 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Christopher Palmer 2006-10-30 22:08:03 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7

Description of problem:
Trying to use the mv command to automatically not overwrite any destination file that already exists using the --reply=no option.  This option seems to behave the same as --reply=yes (just overwrites any existing destination file).
Don't know if this --reply is deprecated or not for mv.  However, --reply=yes and --reply=query seem to work, as well as their other equivalent options.
There doesn't seem to be an equivalent option to --reply=no for mv though?

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

How reproducible:
Always


Steps to Reproduce:
1. echo file1 > file1
2. echo file2 > file2
3. /bin/mv --reply=no file1 file2

Actual Results:
-> the destination file was overwitten / the move took place.

[root@rouge test]# cat file1
cat: file1: No such file or directory
[root@rouge test]# cat file2
file1



Expected Results:
-> mv should have realized that the destination file exists and that we want to answer "no" to any prompt about overwriting.

Additional info:
Comment 1 Tim Waugh 2006-10-31 06:07:40 EST
This is intentional behaviour.  '--reply=no' only applies to prompts that would
have been displayed in the absence of a --reply option.  Since 'mv a b' here
would have succeeded without any prompt, there is no prompt to reply 'no' to.

An example of --reply=no is here:

$ echo a>a
$ echo b>b
$ chmod a-w b
$ mv --reply=no a b
$ cat b
b
$ mv a b
mv: overwrite `b', overriding mode 0444?

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