bug-fileutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: a serious bug in "mv"


From: Jarkko Laukkanen
Subject: Re: a serious bug in "mv"
Date: Fri, 7 Nov 2003 08:39:36 +0200 (EET)

David,

On Wed, 5 Nov 2003, David T-G wrote:
> Actually, this has nothing to do with mv, which was obediently doing what
> it was told to do, and everything to do with shell wildcard expansion
> (which was also behaving).  It is just an unfortunate accident.

Well, sounds like a "undocumented feature a la Microsoft". :o\

> You would have had the same results if you tried
>
>   mv * /path/to/somewhere
>
> but hit <enter> early, too.
>
> % The action "mv Dir/*.*" did not report any error condition. Instead, it
> % copied the "A.txt" into "B.txt" by keeping the original name "B.txt", and
> % hence I lost the "B.txt".
>
> That's because your bare
>
>   mv Dir/*.*
>
> expands to
>
>   mv Dir/A.txt Dir/B.txt
>
> and so mv did exactly that.

You know, I did not intend to purposely execute the division of the string
"Dir/*.*" in to two separate strings.

So, I consider this to be a bug, unless there is any intentionally planned
shell or OS action requiring this kind of formatting of strings in the Linux
system. Can you give any example where this feature is used intentionally?

> HTH & HAND & back up often :-)

I happened to have a recent backup, so the harm was not that big. But still,
the "mv" command behaved unexpectedly.

Regards,

- --
     Jarkko K. Laukkanen, Ph.D.
     Division of X-ray Physics, Department of Physical Sciences,
     University of Helsinki, Helsinki, Finland.

     WWW: http://www.physics.helsinki.fi/~jklaukka/

     "That may be true," he acknowledged, "but it's completely
     accurate, and as long as the answer is right, who cares if
     the question is wrong? If you want sense, you'll have to
     make it yourself."
                          'The Phantom Tollbooth' by Norton Juster




reply via email to

[Prev in Thread] Current Thread [Next in Thread]