Subject: Re: summary unix_rm

From: [email-masked] (Anil G. Mudholkar)
Date: Tue, 30 Aug 94 12:26:32 CDT

In message <[email-masked]>,
Shu-Chuan Jao <[email-masked]> writes:

) 1/ include 
)              alias rm rm -i
)     
)     in  .login file
)     If you want to override this for a large number of files, you
)     can then do something like
)             
)               \rm * or /bin/rm *

	While the rest of this message is full of good advice, I think
that it is very important to strongly warn people against this first
piece of advice for two reasons.

	One should never mask a destructive command with a safer
command.  One day you will be working and say something like rm * and
find everything wiped out because your alias was mysteriously not
active.  Rather, you should choose another name, such as "delete" or
or "del" or something, that has no other meaning.  Then, if "delete"
does not work, it will simply do nothing rather than result in
disaster.

	Also, you are begging for disaster if you put this alias in
your .login file.  The appropriate location would be your .cshrc file
or a file sourced by the .cshrc.  The reason for this is that the
.login file is sourced only by a login shell, where as the .cshrc file
is sourced by all csh and tcsh shells.  Were you to follow the advice
given and then fired up an X-window session which can be configured to
launch all windows as non-login sessions, rm would not behave as rm -i
as you might expect.

	In general, you should put only login-specific commands in
your .login file (hence the name), such as terminal setup commands and
possibly short commands that check for the existence of mail or system
messages, which you might not want to be bothered with at the
invocation of new shells.  The .cshrc file, on the other hand, is run
at the start of all new shells with the exception of those started as
either csh -f or tcsh -f.  This file should contain all information
the you want in all shells.  Refrain from running anything from within
your .cshrc, for it will slow down the invocation of shells and could
result in infinite recursion if there was sloppy programming on
anyone's part (not necessarily yours).

	The advice given in the rest of the message is very good,
particularly sections 2, 3, and 6.  They are very good practices that
are easy to folloe.  Follow these courses rather that the first, and
you will be very happy in the long run.  I would like to comment,
however, that I would recommend the use of RCS (the revision control
system) over SCCS.  The philosophy is the same, but the implementation
has many important advantages that I won't go into.

	Thanks for listening, and happy computing.

				Anil Mudholkar
				[email-masked]
				The James Franck Institute
				5640 Southe Ellis Avenue
				Chicago, IL 60637

---

From: [email-masked] (Anil G. Mudholkar)
Date: Tue, 30 Aug 94 15:33:46 CDT

) 1/ include 
)              alias rm rm -i
)     
)     in  .login file

				Anil Mudholkar