mv: Moving directories to themselves (not the bug with incorrect error message)

2007-11-18 Thread Michal Wencl
Hi.

I'm not sure if this is a bug, feature, todo, or a change request
but I think the current behaviour is not expected for most people.
At least not for those coming from Windows.

My scenario:

mkdir -p a b/a
touch a/1 a/2 b/a/2
move a b

Current result:

In my version of mv (5.97) the following error message is returned:

mv: cannot move `a' to a subdirectory of itself, `b/a'

I know it was changed to a more meaningful message in later version
but this is not the problem.

Expected result:

Directory a is fully moved to directory b/a, thus b/a contains files
1 and 2 where b/a/2 was overwritten witch a/2.

Moreover, this is how mv works if b/a doesn't exist yet. It creates
b/a and moves a/* inside.

Could you think about it, please? It would be great if at least a
switch for it was added to mv (and other coreutils).

Thanks,
Michal Wencl


___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils


Re: mv: Moving directories to themselves (not the bug with incorrect error message)

2007-11-18 Thread Michal Wencl
 As a followup, I'm pretty sure rsync already does what you are looking
 for, so why bloat mv to do something that can be done with another tool?

Thanks for a quick answer. I didn't study rsync deeply yet but I understand it
as a copy utility that temporarily takes filesystem space and wears down a
storage medium when moving files to another directory. That is not necessary
(it's unwanted) in this case. The mv --merge you proposed might still be
useful.



___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils