emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Dangerous shell commands? (was: CUA mode's C-RET binding)


From: Reiner Steib
Subject: Dangerous shell commands? (was: CUA mode's C-RET binding)
Date: Wed, 12 Mar 2008 21:21:51 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

On Wed, Mar 12 2008, Manoj Srivastava wrote:

> On Wed, 12 Mar 2008 11:12:05 -0400, Richard Stallman <address@hidden> said: 
>
>>          A more plausible scenario is if I have recently run "rm -rf .",
>>      in a directory where that was appropriate.  Now I have cd'd to a
>>      different directory (perhaps even my home directory), where
>>      executing that command could do damage.
>
>> Yes, it could.  But what can we do about that rare case without
>> causing lots and lots of hassles in more common cases?
>
>         The shell that I occassionally use, zsh, has an optional
>  mechanism that intercepts "rm -rf *", and asks a y-or-n-p kind of
>  question, *but* (and this is critical) -- adds a 10 second window where
>  keystrokes are ignored.  I like that feature, it makes me take a time
>  out, think about what I am doing, and prevents my fingers from learning 
>  "rm -rf *<RET>y<RET>" as the sequence to use.

If I type `rm -rf', I actually *want* "never prompt".  If I'd like to
have "prompt before every removal", I use `-i'.

I also have `unalias cp mv rm ln 2>/dev/null' in my shell init files
to undo stupid alias like alias cp='cp -i'; alias mv='mv -i'; alias
rm='rm -i'.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]