GNU bug report logs - #12339
Bug: rm -fr . doesn't dir depth first deletion yet it is documented to do so.

Previous Next

Package: coreutils;

Reported by: Linda Walsh <coreutils <at> tlinx.org>

Date: Mon, 3 Sep 2012 00:34:02 UTC

Severity: normal

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


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

From: Bernhard Voelker <mail <at> bernhard-voelker.de>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: Jim Meyering <meyering <at> redhat.com>, "Linda A. Walsh" <law <at> tlinx.org>,
	"12339 <at> debbugs.gnu.org" <12339 <at> debbugs.gnu.org>
Subject: Re: bug#12339: [PATCH] rm: avoid bogus diagnostic for a
	slash-decorated symlink-to-dir
Date: Wed, 05 Sep 2012 08:41:34 +0200
On 09/05/2012 08:25 AM, Paul Eggert wrote:
> On 09/04/2012 06:55 PM, Linda A. Walsh wrote:
>  
>> So how do delete all files in the directory without wild cards?
>
> Why tie your hands behind your back?  Use wild cards:
> 
>   cd DIRECTORY && rm -fr * .[!.] .??*
> 
> If you do this a lot, put it into a shell script.
> It's not like the need is all that common, for most people,
> but if you need it that's what scripts are for.
> 
> If you fiddle with your shell settings about
> how wildcards are expanded, make
> sure your script does wildcards in the standard way.

Exactly, we're now at the point where globbing is the topic,
much way away from coreutils and rm.

Bash knows dotglob:

  $ mkdir d    ; cd d
  $ touch .a b ; mkdir c
  $ ( shopt -s dotglob ; rm -rv * )
  removed `.a'
  removed `b'
  removed directory: `c'

Have a nice day,
Berny




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

Previous Next


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