Bug 213185 - mv --reply=no not working
Summary: mv --reply=no not working
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: coreutils
Version: 4.2
Hardware: i686
OS: Linux
Target Milestone: ---
: ---
Assignee: Tim Waugh
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2006-10-31 03:08 UTC by Christopher Palmer
Modified: 2007-11-17 01:14 UTC (History)
1 user (show)

Clone Of:
Last Closed: 2006-10-31 11:07:40 UTC

Attachments (Terms of Use)

Description Christopher Palmer 2006-10-31 03:08:03 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20060909 Firefox/

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):

How reproducible:

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

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 11:07:40 UTC
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
$ 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.