GNU bug report logs - #25817
rm: add option to avoid early exit on "."

Previous Next

Package: coreutils;

Reported by: L A Walsh <coreutils <at> tlinx.org>

Date: Mon, 20 Feb 2017 19:42:02 UTC

Severity: wishlist

Full log


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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Eric Blake <eblake <at> redhat.com>, L A Walsh <coreutils <at> tlinx.org>
Cc: 25817 <at> debbugs.gnu.org
Subject: Re: bug#25817: Why were Gnu coding standards violated in favor of
 posix for 'rm -fr .'?: request for reversion of behavior
Date: Tue, 21 Feb 2017 08:55:47 -0800
On 02/21/2017 05:42 AM, Eric Blake wrote:
> "If either of the files dot or dot-dot are specified as the basename
> portion of an operand (that is, the final pathname component), rm will
> write a diagnostic message to standard error and do nothing more with
> such operands."

The same wording is in the first version of POSIX that standardized 
'rm', namely IEEE Std 1003.2-1992 section 4.53.2 lines 8384-6. So we are 
looking at 25 years' worth of standardization here.

Going back even further in time, 7th Edition Unix 'rm' was confused in 
this area. Although 'rm -r ..' had the POSIX-specified behavior, 'rm -r 
.' removed all subfiles and then quietly succeeded without removing '.', 
and there were other complications. Presumably this mess is what the 
early-1990 standardizers were trying to avoid.

At any rate I agree that the requested behavior should be enabled only 
via a new option. Regardless of what one thinks 'rm' should do if we 
could redesign it from scratch, there's too much dead weight of history 
here.





This bug report was last modified 6 years and 232 days ago.

Previous Next


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