Is it true that Brian Kernighan while developing rm
accidentally tested the project so that it removed itself? Then, according to story, he had to start over from the beginning because there was no backup. I heard the story from somebody but could not verify that it is true.
1 Answer
rm
is attributed to Ken Thompson and Dennis Ritchie (see the original man page, and the attribution in the Unix history repository), so the story in question doesn’t ring true.
Brian Kernighan was involved with Unix since very early days, so it’s still possible, but he wouldn’t have been a primary developer on rm
. In any case rm
is simple enough, even in V7, that its deletion wouldn’t have been much of a loss; it wouldn’t have taken long to re-create.
As an aside, specifying rm
as a script’s shebang allows an executable to delete itself when executed (along with any file given as argument).
-
It's possible though that in retelling the story from memory the only detail the OP got wrong was who it happened to. May 14 at 1:08
-
4It's likely that, if one aspect of the story is false, others will be as well :-) May 14 at 7:53
rm -r /
. which would have the effect described.