[Top][All Lists]
[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
- Re: CUA mode's C-RET binding [was: position on changing defaults?], (continued)
- Re: CUA mode's C-RET binding [was: position on changing defaults?], Lennart Borgman (gmail), 2008/03/10
- Re: CUA mode's C-RET binding [was: position on changing defaults?], Johan Bockgård, 2008/03/10
- Re: CUA mode's C-RET binding [was: position on changing defaults?], Lennart Borgman (gmail), 2008/03/10
- Re: CUA mode's C-RET binding [was: position on changing defaults?], Juri Linkov, 2008/03/10
- Re: CUA mode's C-RET binding [was: position on changing defaults?], Richard Stallman, 2008/03/11
- Re: CUA mode's C-RET binding, Manoj Srivastava, 2008/03/11
- Re: CUA mode's C-RET binding, Juri Linkov, 2008/03/11
- Re: CUA mode's C-RET binding, Richard Stallman, 2008/03/12
- Re: CUA mode's C-RET binding, Manoj Srivastava, 2008/03/12
- Dangerous shell commands? (was: CUA mode's C-RET binding), Reiner Steib, 2008/03/12
- Re: Dangerous shell commands?,
David Kastrup <=
- Re: Dangerous shell commands?, Manoj Srivastava, 2008/03/12
- Re: CUA mode's C-RET binding [was: position on changing defaults?], Mathias Dahl, 2008/03/11
- RE: CUA mode's C-RET binding [was: position on changing defaults?], Drew Adams, 2008/03/11
- Re: CUA mode's C-RET binding [was: position on changing defaults?], Mathias Dahl, 2008/03/13
- RE: CUA mode's C-RET binding [was: position on changing defaults?], Drew Adams, 2008/03/13
- Re: position on changing defaults?, Richard Stallman, 2008/03/11
- Re: position on changing defaults?, Kim F. Storm, 2008/03/08
- Re: position on changing defaults?, Stefan Monnier, 2008/03/08
- Re: position on changing defaults?, Kim F. Storm, 2008/03/08
- Re: position on changing defaults?, Miles Bader, 2008/03/08