The phrase dates back to Zork I

Two games earlier, in Zork I, there is a sequence in which one must acquire and make proper use of a bell, a book, and a candle. If you merely look at the book, it seems to be "a Philippic against small insects", among other things. If you should happen to read the book, the following text appears:


O ye who go about saying unto each, "Hello Sailor":
Dost thou know the magnitude of thy sin before the gods?
Yea, verily, thou shalt be ground between two stones.
Shall the angry gods cast thy body into the whirlpool?
Surely, thy eye shall be put out with a sharp stick!
Even unto the ends of the earth shalt thou wander and
Unto the land of the dead shalt thou be sent at last.
Surely thou shalt repent of thy cunning.

This text turns out to be useful not only for the "Hello Sailor". Its other importance must be glimpsed in order to make it through Zork I.