fixing rm *

Geoff Clare gwc at root.co.uk
Mon Nov 21 21:27:02 AEST 1988


In article <1615 at basser.oz> john at basser.oz (John Mackin) writes:

}The point about any hack that is supposed to make mistakes in
}command lines, say rm command lines, less dangerous is that it's
}just fine as long as the people who are going to use it are never,
}at any time in the future, going to use a different UNIX system on
}which the hack doesn't exist.  When they do, they will get into
}big trouble, because they won't be used to being careful with
}`dangerous' commands, like rm; they'll expect the system to
}babysit them, and it won't, just like it never should have in
}the first place.
}
}I know systems where rm is interactive by default.  I've personally
}seen plenty of users on such systems whose habitual way of cleaning
}up a directory was `rm *'.  How much trouble will they be in when
}they go somewhere else that runs a _real_ rm command?
}
}Hacks like this are a _terrible_ idea.  Please do not
}implement such things.

I wouldn't go so far as to say don't implement them at all.
What I would say is CALL THEM SOMETHING ELSE.  If you implement a
safe 'rm', call it something else like 'del', and tell novice users
not to use 'rm' because it is dangerous.  (To make sure they don't
use it you could put a dummy 'rm' in their path which echoes "rm is
dangerous - use del instead".  Then when they move to a different
system and they get 'del: not found' they will know how to use 'rm'
but will be careful with it.
-- 

Geoff Clare    UniSoft Limited, Saunderson House, Hayne Street, London EC1A 9HH
gwc at root.co.uk   ...!mcvax!ukc!root44!gwc   +44-1-606-7799  FAX: +44-1-726-2750



More information about the Comp.unix.wizards mailing list