GNU bug report logs - #64326
Bug in rm command

Previous Next

Package: coreutils;

Reported by: LitHack <lithack0 <at> gmail.com>

Date: Wed, 28 Jun 2023 14:51:01 UTC

Severity: normal

Tags: notabug

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 64326 in the body.
You can then email your comments to 64326 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#64326; Package coreutils. (Wed, 28 Jun 2023 14:51:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to LitHack <lithack0 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Wed, 28 Jun 2023 14:51:02 GMT) Full text and rfc822 format available.

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

From: LitHack <lithack0 <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: Bug in rm command
Date: Wed, 28 Jun 2023 18:05:17 +0530
[Message part 1 (text/plain, inline)]
There is bug in rm command by which we can not delete a special file with
dash(-) in front of them.

Like rm -file, rm "-file" will not delete the file (-file)
[Message part 2 (text/html, inline)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#64326; Package coreutils. (Wed, 28 Jun 2023 15:35:02 GMT) Full text and rfc822 format available.

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

From: LitHack <lithack0 <at> gmail.com>
To: 64326 <at> debbugs.gnu.org
Subject: Some more info about rm bug
Date: Wed, 28 Jun 2023 20:32:45 +0530
[Message part 1 (text/plain, inline)]
Basically what it doing is that it doesn't recognise (-) this as a file
name part even when using (\-). This bug will work on most of utilities
like cat, cp etc

Thanks and regards
[Message part 2 (text/html, inline)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#64326; Package coreutils. (Wed, 28 Jun 2023 15:45:02 GMT) Full text and rfc822 format available.

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

From: Arsen Arsenović <arsen <at> aarsen.me>
To: LitHack <lithack0 <at> gmail.com>
Cc: 64326 <at> debbugs.gnu.org, bug-coreutils <at> gnu.org
Subject: Re: bug#64326: Some more info about rm bug
Date: Wed, 28 Jun 2023 17:41:13 +0200
[Message part 1 (text/plain, inline)]
Hi,

LitHack <lithack0 <at> gmail.com> writes:

> Basically what it doing is that it doesn't recognise (-) this as a file
> name part even when using (\-). This bug will work on most of utilities
> like cat, cp etc

This is simply how argument parsing and shell syntax work.  'rm \-abc'
is equivalent to just 'rm -abc', which is parsed as 'rm -a -b -c'.  To
delete a file with a dash at the start of its name, use 'rm ./-file' and
similar.

Hope that helps, have a lovely day.
-- 
Arsen Arsenović
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#64326; Package coreutils. (Wed, 28 Jun 2023 15:45:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-coreutils <at> gnu.org:
bug#64326; Package coreutils. (Wed, 28 Jun 2023 17:34:02 GMT) Full text and rfc822 format available.

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

From: Chris Elvidge <celvidge001 <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: Re: bug#64326: Some more info about rm bug
Date: Wed, 28 Jun 2023 18:33:07 +0100
Or rm -- -abc

The "double-dash" signals "end of options"

On 28/06/2023 16:41, Arsen Arsenović via GNU coreutils Bug Reports wrote:
> Hi,
> 
> LitHack <lithack0 <at> gmail.com> writes:
> 
>> Basically what it doing is that it doesn't recognise (-) this as a file
>> name part even when using (\-). This bug will work on most of utilities
>> like cat, cp etc
> 
> This is simply how argument parsing and shell syntax work.  'rm \-abc'
> is equivalent to just 'rm -abc', which is parsed as 'rm -a -b -c'.  To
> delete a file with a dash at the start of its name, use 'rm ./-file' and
> similar.
> 
> Hope that helps, have a lovely day.
> 


-- 

Chris Elvidge




Added tag(s) notabug. Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Wed, 28 Jun 2023 18:24:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 64326 <at> debbugs.gnu.org and LitHack <lithack0 <at> gmail.com> Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Wed, 28 Jun 2023 18:24:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-coreutils <at> gnu.org:
bug#64326; Package coreutils. (Wed, 28 Jun 2023 21:03:02 GMT) Full text and rfc822 format available.

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

From: Bernhard Voelker <mail <at> bernhard-voelker.de>
To: Chris Elvidge <celvidge001 <at> gmail.com>, 64326 <at> debbugs.gnu.org
Subject: Re: bug#64326: Some more info about rm bug
Date: Wed, 28 Jun 2023 23:02:03 +0200
tag 64326 notabug
close 64326
stop

On 6/28/23 19:33, Chris Elvidge wrote:
> On 28/06/2023 16:41, Arsen Arsenović via GNU coreutils Bug Reports wrote:
>> Hi,
>>
>> LitHack <lithack0 <at> gmail.com> writes:
>>
>>> Basically what it doing is that it doesn't recognise (-) this as a file
>>> name part even when using (\-). This bug will work on most of utilities
>>> like cat, cp etc
>>
>> This is simply how argument parsing and shell syntax work.  'rm \-abc'
>> is equivalent to just 'rm -abc', which is parsed as 'rm -a -b -c'.  To
>> delete a file with a dash at the start of its name, use 'rm ./-file' and
>> similar.
>>
>> Hope that helps, have a lovely day.

> Or rm -- -abc
>
> The "double-dash" signals "end of options"

And finally: FAQ #11 - #13:
https://www.gnu.org/software/coreutils/faq/coreutils-faq.html#How-do-I-remove-files-that-start-with-a-dash_003f

I'm hereby closing this issue as not-a-bug.

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. (Thu, 27 Jul 2023 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 334 days ago.

Previous Next


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