In a message dated: Mon, 26 Nov 2001 06:18:27 PST
Ken Ambrose said:

>Hmmm.  A point all of you are making is how bad RH is for aliasing "rm -i"
>because it gets you used to it.

Well, yes and no.  I'm trying to make the point that aliases which 
have the same name as a real command, but different output than the 
default are a bad idea.  Not just rm='rm -i', but things like ls='ls -F',
and any other command where the actual command is replaced by an 
alias.

>Well... they don't.  Except as root.

IMO, it doesn't matter whether it's as root or not.  They shouldn't 
be trying to protect anyone.  You learn from making mistakes, and 
they are now preventing people from making those very mistakes from 
which they'll learn the most.  Okay, so maybe you think 1 alias for a 
neophyte is acceptable, especially since a neophyte might not really 
understand the implications of running the rm command as root.  Well, 
given that the majority of Linux users are doing so in their own home 
where they're not likely to bring down corporate America, what better 
place to learn the hard way?  They're likely to have to re-install 2 
or 3 times anyway :)

But seriously.  When I first started as a junior sysadmin, I wasn't 
even allowed to have the root password for about 2 months or so.  And 
once I was given root, I was only allowed to use it "with 
supervision" (the environment was such that I didn't need to do 
anything as root unless my mentor was there anyway).  Each time I needed
to do something, my mentor would remind me to look at the command I 
just typed, review it carefully, and make sure it was going to do 
exactly what I expected it to do.  As a result, to this day, I 
continue to review my commands as root prior to hitting the return 
key.

Had I gotten used to rm='rm -i' I would have gotten used to something 
other than the default action, and as soon as I used a system where 
that was not the default, I would probably have hosed up something 
really bad and not have a clue as to what I did wrong, which, in 
reality, was nothing.  In fact, it was the system I was used to which 
did something wrong, and I got used to it.

>You guys aren't running as root all the time, are you? ;-)  That would be yet
>another bad thing (YABT).

While I agree, and almost never run as root on any system (even my 
own home systems, in fact, sudo is installed everywhere I log in :) 
there are cases for extended runs as root.  But if you're careful, 
diligent, and understand exactly what you're doing, then there's no 
need to worry.  Aliases, especially ones that kick in only as root, 
are, IMO, REALLY BAD.  If you spend 99% of your time in an 
environment you're going to get used to the way it works.  The 1% of 
the time you switch to an environment which is even slightly 
different is exactly when Murphy will return from vacation.  And 
remember, he was an optimist!

When I was at Raytheon, we actually modified root's dot files to 
search for a .rootrc file in the user's home directory and exec it if 
found.  The .rootrc file was usually nothing more than a symlink to 
our .kshrc which was configured to test for the root user and change 
the prompt to 'root@hostname' or some such so we'd know we were root, 
not ourselves.  But we had exactly our own environment as root, so 
things always worked exactly the way we expected them too.  No 
surprises.

Of course, with sudo, this is now a pointless excercise :)

>I happen to think it's handy to have rm, when root, changed to "rm -i": 

Well, good luck to you :)  I think it's a dangerous habit to get used to.

-- 

Seeya,
Paul
----

                          God Bless America!

        ...we don't need to be perfect to be the best around,
                and we never stop trying to be better. 
                       Tom Clancy, The Bear and The Dragon



*****************************************************************
To unsubscribe from this list, send mail to [EMAIL PROTECTED]
with the text 'unsubscribe gnhlug' in the message body.
*****************************************************************

Reply via email to