The verses in Ecclesiastes 9:7-9 say:
Go, eat your food with gladness, and drink your wine with a joyful heart, for it is now that God favors what you do. Always be clothed in white, and always anoint your head with oil. Enjoy life with your wife, whom you love, all the days of this meaningless life that God has given you under the sun— all your meaningless days. For this is your lot in life and in your toilsome labor under the sun.
In Gilgamesh X in the third column our hero, Gilgamesh, is mourning the loss of his best friend (dead) and is trying to find a way to achieve his own immortality. He meets an alewife who tries to discourage him from this. She says to him,
"Gilgamesh, fill your belly with good things; day and night dance and be merry, feast and rejoice. Let your clothes be fresh, bathe yourself in water, cherish the little child that holds your hand, and make your wife happy in your embrace, for this too is the lot of man.”
Notice the similarities here... looking at the mortality of humanity, the authors each tell a man to enjoy his food, to take joy in these celebrations, to put on his best clothes and wash himself for a celebration and to enjoy his wife. Because this is the lot of humanity.
Its such a fascinating allusion. Qohelet (which is how the author of Ecclesiastes refers to himself) is making reference to this story about a man trying to overcome death and pulling from it the wise advice given to him... stop running after immortality, enjoy the life you have and take pleasure in the things that have been given to you... good food and celebration and family.
I wonder if Qohelet references other literary works from the time and we simply don't know about them or don't have those works any longer. It seems like it might color the meaning a little in places if he's making a clear reference to a story everyone would know, and the audience at that time would say, Ah, he's talking about the story of Gilgamesh. It's like trying to read The Wasteland without knowing any of its referents.
Anyway... I thought it was interesting and that I would share.