From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: Dangerous shell commands? Date: Wed, 12 Mar 2008 22:23:38 +0100 Message-ID: <85lk4nd4bp.fsf@lola.goethe.zz> References: <200803050637.m256bXL3008361@sallyv1.ics.uci.edu> <87pru8enjx.fsf@kfs-lx.rd.rdm> <871w6l3u8f.fsf@kfs-lx.rd.rdm> <871w6j7cga.fsf@kfs-lx.rd.rdm> <003001c8823a$d7cd5010$0600a8c0@us.oracle.com> <87lk4r5v2o.fsf@kfs-lx.rd.rdm> <003101c88242$18736fd0$0600a8c0@us.oracle.com> <7dbe73ed0803100313g46d079dag91e1b8af1f750ee8@mail.gmail.com> <47D53BF1.70401@gmail.com> <47D54B62.9010404@gmail.com> <87k5kai2y8.fsf@jurta.org> <87wso9c7dn.fsf@anzu.internal.golden-gryphon.com> <87fxuvdf3j.fsf@anzu.internal.golden-gryphon.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1205357115 11234 80.91.229.12 (12 Mar 2008 21:25:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 12 Mar 2008 21:25:15 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 12 22:25:43 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JZYS5-0003wV-Tn for ged-emacs-devel@m.gmane.org; Wed, 12 Mar 2008 22:25:34 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JZYRX-0001LU-6Q for ged-emacs-devel@m.gmane.org; Wed, 12 Mar 2008 17:24:59 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JZYQJ-0000kE-N9 for emacs-devel@gnu.org; Wed, 12 Mar 2008 17:23:43 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JZYQH-0000iq-Cm for emacs-devel@gnu.org; Wed, 12 Mar 2008 17:23:43 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JZYQH-0000ig-6V for emacs-devel@gnu.org; Wed, 12 Mar 2008 17:23:41 -0400 Original-Received: from mail-in-09.arcor-online.net ([151.189.21.49]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JZYQG-0001OF-T5 for emacs-devel@gnu.org; Wed, 12 Mar 2008 17:23:41 -0400 Original-Received: from mail-in-06-z2.arcor-online.net (mail-in-06-z2.arcor-online.net [151.189.8.18]) by mail-in-09.arcor-online.net (Postfix) with ESMTP id ADF2A3029A0 for ; Wed, 12 Mar 2008 22:23:38 +0100 (CET) Original-Received: from mail-in-01.arcor-online.net (mail-in-01.arcor-online.net [151.189.21.41]) by mail-in-06-z2.arcor-online.net (Postfix) with ESMTP id 979515BD6D for ; Wed, 12 Mar 2008 22:23:38 +0100 (CET) Original-Received: from lola.goethe.zz (dslb-084-061-021-081.pools.arcor-ip.net [84.61.21.81]) by mail-in-01.arcor-online.net (Postfix) with ESMTP id 7D18D103D97 for ; Wed, 12 Mar 2008 22:23:38 +0100 (CET) Original-Received: by lola.goethe.zz (Postfix, from userid 1002) id 76B1E1C4F905; Wed, 12 Mar 2008 22:23:38 +0100 (CET) In-Reply-To: (Reiner Steib's message of "Wed, 12 Mar 2008 21:21:51 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-Virus-Scanned: ClamAV 0.92.1/6218/Wed Mar 12 20:07:21 2008 on mail-in-01.arcor-online.net X-Virus-Status: Clean X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:92321 Archived-At: Reiner Steib 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 *y" 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 RET and typed one 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