[net.unix-wizards] enable command

mark (07/21/82)

Several people seem to misunderstand me.  I never said enable is the
cleanest program in the world.  I never intended that it be included in
anybody's standard version of UNIX.  I certainly never advocated
removing the su command.  Think of it like a research paper - I said
what I did, how I did it, and the fact that it seems to work with no
ill effects.  At best it's just an alternative to su.  Those systems
that want to use the idea can, those that don't won't.

The big thing it gains is speed.  Several people pointed out that
history can be gained with a one-line su such as
	su1 !!
The 4.1BSD su command (as modified locally to not modify your
environment, so you don't have to work as root without all your
aliases) has to run your .cshrc, which takes a while.  This was the
only time I ever spent in a subshell, so by getting rid of su shells, I
got rid of the need for my .cshrc.  (This may not apply once there are
multiple windows on my terminal.)

By the way, the code really isn't that unportable.  The proc table
is the only thing it writes on, and that is pretty much the same in
all versions of UNIX I have seen.  The only system dependent parts
are the name of the file to inspect the namelist of (/unix or /vmunix),
the details of calling nlist, and the method of determining the size
of the proc table.  Now, on the other hand, if it had to write directly
in the USER structure, it would be an awful, ugly, very unportable mess.