|
From: | Paul Eggert |
Subject: | bug#69532: mv's new -x option should be made orthogonal to -t/-T/default |
Date: | Sun, 3 Mar 2024 16:44:52 -0800 |
User-agent: | Mozilla Thunderbird |
I expect 'mv -x A B' to act like 'mv A B' except the destination must exist and is renamed back to A. However, this is not true for 'mv -x A B' when B is a directory; it renames B to A rather than renaming B/A to A as I expect. That is, 'mv -x' acts as if -T (--no-target-directory) is also specified. There is no way to get mv's traditional behavior, or to get mv -t behavior.
To fix this, 'mv -x' should respect the usual mv behavior with respect to directories. For example, when D is a directory 'mv -x A B C D' should act like 'mv A B C D' except that D's old entries should be renamed back to A B and C. And the -t and -T options should work with -x the same way they work when -x is not specified.
This needs to happen before the next coreutils release, to avoid confusion about 'mv -x'.
[Prev in Thread] | Current Thread | [Next in Thread] |