In the first episode of Lost in Space that I'd ever watched, Robot (the robot) quoted part of Hamlet's Yorick speech (for which, q.v.).
A note in the comments on that post mentioned another episode with a quote from Shakespeare. After some searching, I tracked it down.
In this exciting first-season episode, the scheming Dr. Smith, who only wants to get back to earth, has figured out a way to reduce the spaceship's payload by 200 pounds—the weight of one adult male. He's programed Robot to accept commands only from his own voice. Apropos of very little, Dr. Smith asks Robot, "What was it they said about the fallen sparrow?" That gives Robot the chance to define the "they" of his question and then to provide the full quotation:
I find it interesting that Robot goes to Act V of Hamlet with the very loose parameters Dr. Smith gives him for the reference. Why not go to Luke 12:6-7? That reads, in the Geneva Bible of 1560,
It's also interesting that Robot is also programmed with the works of Samuel Butler. That seems to impress Dr. Smith less—but I don't know if it's because knowing Butler is less impressive or if the "spot the quote" party trick has palled by that point.Are not fiue sparowes bought for two farthings, and yet not one of them is forgotten before God? Yea, and all the heares of your head are nombred: feare not therefore: yee are more of value then many sparowes.
Links: The Episode at IMDB.