GNU bug report logs - #6104
[Expert] Bug in mv?

Previous Next

Package: coreutils;

Reported by: Gene Heskett <gene.heskett <at> gmail.com>

Date: Wed, 5 May 2010 03:56:01 UTC

Severity: normal

Merged with 6118

Done: Bob Proulx <bob <at> proulx.com>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Gene Heskett <gene.heskett <at> gmail.com>
To: expert <at> mandrivalinux.org, bug-coreutils <at> gnu.org
Subject: Re: [Expert] Bug in mv?
Date: Tue, 04 May 2010 23:09:01 -0400
On Tuesday 04 May 2010, João Victor Martins wrote:
>On Tue, May 04, 2010 at 10:36:19PM -0400, Gene Heskett wrote:
>> I tried to "mv amanda* /home/amanda/*" as root and which
>> which I recall I have done successfully several times before.
>
>The shell expand * _before_ passing the args to mv.  So mv saw all
>files starting with 'amanda' and all files (besides . hidden ones) in
>/home/amanda/ as arg.  It then picked the last one listed (probably
>/home/amanda/tmp/) as destination.
>
I had two files whose names started with amanda in that directory.  I would 
have assumed it would expand the src pattern of "amanda*" to match only those 
two files.  And the rest of the files in /home/me, weren't bothered.  No 
damages to the src directory at all other than removing the files.

If it expanded that * to include the whole thing, it should have moved the 
whole thing.  It didn't.  In past experience, the target path spec's /* has 
always served as just a place holder for the filenames actually selected by 
the amanda* in the src spec.  That is not what it did this time.  This time 
it created a tmp/ directory in /home/amanda, moved the whole amanda tree to 
the tmp directory, including the two files I actually asked it to move from 
/home/me/Download.  No loss, but a very surprised veteran linux user.

Someplace, the plans of mice and men have definitely gone aglay here, so I've 
included bug-coreutils <at> gnu.org.

-- 
Cheers, Gene
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Every nonzero finite dimensional inner product space has an orthonormal 
basis.

It makes sense, when you don't think about it.






This bug report was last modified 13 years and 326 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.