GNU bug report logs - #24294
Bug in mv, -- and - prefixes

Previous Next

Package: coreutils;

Reported by: Miku <10mkudela <at> gmail.com>

Date: Tue, 23 Aug 2016 17:22:02 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 24294 in the body.
You can then email your comments to 24294 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#24294; Package coreutils. (Tue, 23 Aug 2016 17:22:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Miku <10mkudela <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Tue, 23 Aug 2016 17:22:02 GMT) Full text and rfc822 format available.

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

From: Miku <10mkudela <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: Bug in mv, -- and - prefixes
Date: Tue, 23 Aug 2016 19:08:05 +0200
Hello

When doing "mv * dest_folder" and one of files in directory starts with 
-- or - it sees that as an option.

For instance if one of files is named "-v" or "--version" then "mv * 
dest_folder" would work like "mv -v * dest_folder" and "mv --version"

MichaƂ





Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Tue, 23 Aug 2016 17:29:02 GMT) Full text and rfc822 format available.

Notification sent to Miku <10mkudela <at> gmail.com>:
bug acknowledged by developer. (Tue, 23 Aug 2016 17:29:02 GMT) Full text and rfc822 format available.

Message #10 received at 24294-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Miku <10mkudela <at> gmail.com>, 24294-done <at> debbugs.gnu.org
Subject: Re: bug#24294: Bug in mv, -- and - prefixes
Date: Tue, 23 Aug 2016 10:28:39 -0700
Miku wrote:

> When doing "mv * dest_folder" and one of files in directory starts with -- or -
> it sees that as an option.
>
> For instance if one of files is named "-v" or "--version" then "mv *
> dest_folder" would work like "mv -v * dest_folder" and "mv --version"

This is not really a bug in mv, as the shell expands the "*" before invoking mv. 
 To work around the problem, use "mv -- * dest_folder".





Information forwarded to bug-coreutils <at> gnu.org:
bug#24294; Package coreutils. (Tue, 23 Aug 2016 17:45:01 GMT) Full text and rfc822 format available.

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

From: Reuti <reuti <at> staff.uni-marburg.de>
To: Miku <10mkudela <at> gmail.com>
Cc: 24294 <at> debbugs.gnu.org
Subject: Re: bug#24294: Bug in mv, -- and - prefixes
Date: Tue, 23 Aug 2016 19:29:13 +0200
Hi,

Am 23.08.2016 um 19:08 schrieb Miku:

> Hello
> 
> When doing "mv * dest_folder" and one of files in directory starts with -- or - it sees that as an option.
> 
> For instance if one of files is named "-v" or "--version" then "mv * dest_folder" would work like "mv -v * dest_folder" and "mv --version"

You can switch if off by -- as an option, i.e.:

$ mv -- --foo -bar

The -- ends the list of options and works with `touch`, `rm` and others too.

-- Reuti



Information forwarded to bug-coreutils <at> gnu.org:
bug#24294; Package coreutils. (Tue, 23 Aug 2016 18:29:02 GMT) Full text and rfc822 format available.

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

From: Bernhard Voelker <mail <at> bernhard-voelker.de>
To: Miku <10mkudela <at> gmail.com>, 24294 <at> debbugs.gnu.org
Subject: Re: bug#24294: Bug in mv, -- and - prefixes
Date: Tue, 23 Aug 2016 20:28:27 +0200
On 08/23/2016 07:08 PM, Miku wrote:
> Hello
> 
> When doing "mv * dest_folder" and one of files in directory starts with 
> -- or - it sees that as an option.
> 
> For instance if one of files is named "-v" or "--version" then "mv * 
> dest_folder" would work like "mv -v * dest_folder" and "mv --version"

Besides the answer of Paul and Reuti, this is an FAQ (actually there are
several like these caused by shell file globbing around that):

http://www.gnu.org/software/coreutils/faq/coreutils-faq.html#I-have-a-file-_0027_002df_0027-and-it-affects-rm_002e

Have a nice day,
Berny




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 21 Sep 2016 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 329 days ago.

Previous Next


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