URL: <http://savannah.gnu.org/bugs/?22646>
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: <http://savannah.gnu.org/bugs/?22646> _______________________________________________ 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