emacs-devel
[Top][All Lists]
Advanced

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

Re: Dangerous shell commands?


From: David Kastrup
Subject: Re: Dangerous shell commands?
Date: Wed, 12 Mar 2008 22:23:38 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

Reiner Steib <address@hidden> writes:

> On Wed, Mar 12 2008, Manoj Srivastava wrote:
>
>>         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'.

One of the most dreaded messages once it sinks in:

rm: cannot remove `.o': No such file or directory

Spoiler:

This is after
rm * .o

And I agree that I don't want a prompt when I do
rm -rf *

However, when I type
<up> <up> <up> RET

and typed one <up> too many, namely when I did _not_ actually type the
terrible command, getting asked a question would not be amiss.

I have actually, after this has happened to me once or twice, taken the
pain to look up what to do in order to not have a command enter the
command history at all.

> 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'.

In important directories (using POSIX sort order),

touch ./-i

can become a life saver at some future point of time.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

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