Mon 17 Mar 2008 10:16:03 PM UTC, original submission:
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
|