Second Variety is a post-apocalyptic science fiction story by Philip K. Dick, author of many short stories in the science fiction genre which have been adapted to more recognizable films such as Total Recall. Second Variety was a significant inspiration for the plotlines of the Terminator series and the second Battlestar Galactica television series.
Second Variety takes place after a nuclear war between the Soviet Union and the United Nations. The Russians effectively destroy much of the planet, and the United Nations forces retreat to a base on the Moon. The UN forces develop automated robots called "claws" which can replicate themselves and attack the Russian forces without any guidance from the UN; they then unleash these robots on the Earth.
The claws are incredibly successful at destroying the Russian forces, but the robots go out of control, and they begin creating more advanced robots that look identical to humans. The robots appear to be intent on destroying all human life; they are capable of attacking both the UN and Russian forces, and it is very difficult to identify a humanoid robot without killing them, making the humans suspicious of each other.
By the end of the story, paranoia has turned some of the human characters against each other, but they are overwhelmed by the robots and must retreat to the moon, however the spaceship available to them has room for only one person. In a tragic ending, it is revealed that the person sent back to the moon was actually one of the robots, effectively dooming humanity's last refuge to destruction.