[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#10819: [BUG][RM]
From: |
Eric Blake |
Subject: |
bug#10819: [BUG][RM] |
Date: |
Thu, 16 Feb 2012 08:28:21 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20120131 Thunderbird/10.0 |
On 02/16/2012 03:59 AM, Jim Meyering wrote:
>> 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.
You can always use 'rm -rf dummy $file_list' without having to check for
whether $file_list is empty, but yes, that is the primary reasoning why
-f with no options behaves differently than any other case with no options.
FYI: I just opened a POSIX bug report, asking that this usage be
codified (since everyone that I tested already does it):
http://austingroupbugs.net/view.php?id=542
--
Eric Blake address@hidden +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- bug#10819: [BUG][RM], address@hidden, 2012/02/15
- bug#10819: [BUG][RM], Eric Blake, 2012/02/15
- bug#10819: [BUG][RM], Davide Brini, 2012/02/16
- bug#10819: [BUG][RM], Jim Meyering, 2012/02/16
- bug#10819: [BUG][RM], Voelker, Bernhard, 2012/02/16
- bug#10819: [BUG][RM], Jim Meyering, 2012/02/16
- bug#10819: [BUG][RM], Voelker, Bernhard, 2012/02/16
- bug#10819: [BUG][RM], Jim Meyering, 2012/02/16
- bug#10819: [BUG][RM], Voelker, Bernhard, 2012/02/16
- bug#10819: [BUG][RM],
Eric Blake <=
- bug#10819: [BUG][RM], Jim Meyering, 2012/02/16
- bug#10819: [BUG][RM], Stefano Lattarini, 2012/02/16
- bug#10819: [BUG][RM], Eric Blake, 2012/02/16
- bug#10819: [BUG][RM], Philip Rowlands, 2012/02/16
- bug#10819: POSIX will say running "rm -f" with no argument is OK, Stefano Lattarini, 2012/02/16