[bug #22646] RFE: -I option for rm: prompt once on directories

2008-03-17 Thread anonymous

URL:
  

 Summary: RFE: -I option for rm: prompt once on directories
 Project: GNU Core Utilities
Submitted by: None
Submitted on: Monday 17/03/08 at 22:16 UTC
Category: None
Severity: 3 - Normal
  Item Group: None
  Status: None
 Privacy: Public
 Assigned to: None
 Open/Closed: Open
 Discussion Lock: Any

___

Details:

When using "rm -ir *", it can get pretty tedious confirming once for every
file, within directories. However, I prefer not to skip the safety-belt
entirely by abandoning the -i.

I propose adding a new flag, -I, which behaves in the same way as -i, except
that directories are only confirmed once for the whole directory.

Current behaviour:

[~/temp]$ touch a b ; mkdir c ; touch c/{d,e,f,g,h}
[~/temp]$ rm -ir *
rm: remove regular empty file `a'? y
rm: remove regular empty file `b'? y
rm: descend into directory `c'? y
rm: remove regular empty file `c/d'? y
rm: remove regular empty file `c/e'? y
rm: remove regular empty file `c/f'? y
rm: remove regular empty file `c/g'? y
rm: remove regular empty file `c/h'? y
rm: remove directory `c'? y
[~/temp]$

Proposed behaviour:

[~/temp]$ touch a b ; mkdir c ; touch c/{d,e,f,g,h}
[~/temp]$ rm -Ir *
rm: remove regular empty file `a'? y
rm: remove regular empty file `b'? y
rm: remove directory `c' and all its contents? y
[~/temp]$

Personally, I'd then change my .bashrc from "alias rm='rm -i'" to "alias
rm='rm -I', though I do realise that this is controversial ;-)

Just an idea - hope you like it. Thanks for all your work on GNU - much
appreciated! - Richard








___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/



___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils


[bug #22646] RFE: -I option for rm: prompt once on directories

2008-03-17 Thread James Youngman

Follow-up Comment #1, bug #22646 (project coreutils):

No need to change coreutils to get this behaviour:

$ find . -depth -mindepth 1  -type d  -ok rm -rf {} ;
< rm ... ./wimpole > ? y
< rm ... ./baz > ? y
< rm ... ./quux > ? y
< rm ... ./foo/bar > ? y
< rm ... ./foo > ? y
< rm ... ./ugh > ? y


___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/



___
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils