GNU bug report logs - #10819
[BUG][RM]

Previous Next

Package: coreutils;

Reported by: "jeremy.magrin <at> epitech.eu" <jeremy.magrin <at> epitech.eu>

Date: Wed, 15 Feb 2012 17:11:02 UTC

Severity: normal

Tags: moreinfo

Done: "Voelker, Bernhard" <bernhard.voelker <at> siemens-enterprise.com>

Bug is archived. No further changes may be made.

Full log


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

From: Jim Meyering <jim <at> meyering.net>
To: "Voelker\, Bernhard" <bernhard.voelker <at> siemens-enterprise.com>
Cc: "10819 <at> debbugs.gnu.org" <10819 <at> debbugs.gnu.org>,
	Davide Brini <dave_br <at> gmx.com>
Subject: Re: bug#10819: [BUG][RM]
Date: Thu, 16 Feb 2012 11:59:05 +0100
Voelker, Bernhard wrote:

> Jim Meyering wrote:
>> Davide Brini wrote:
>> ...
>> > At least in bash, but I suppose in other shells too,
>> >
>> > rm -rf #*
>> >
>> > treats the "#*" part as a comment, and (if you remove the "-f") complains
>> > about missing operand to rm.
>>
>> That is the default, but for an interactive shell,
>> that behavior can be changed:
>>
>>     $ echo a b # c
>>     a b
>>     $ shopt -u interactive_comments
>>     $ echo a b # c
>>     a b # c
>
> I think Davide's point is not about the # comment ... rm won't see
> that on argv anyway. The point is that 'rm -f' does not complain about
> missing operands while 'rm' does:
>
>   $ rm
>   rm: missing operand
>   Try `rm --help' for more information.
>   $ rm -f
>   $
>
> According to the info, '-f' just silences error messages for files
> which do not exist (and never to prompt for confirmation), but why
> should it also affect the "missing operand" message?

Two reasons:

 - that's what rm -f has always done
 - because that's more useful.  Otherwise, "rm -rf $file_list" would
   have to be wrapped in code to handle specially the case in which
   $file_list is empty.




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

Previous Next


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