Last Of The Summer Wine will bow out with a line from the show's longest serving star Peter Sallis, it was revealed today.
As the final episode comes to a close later this month, Sallis's character Clegg says: "Did I lock the door?"
The finale of the BBC One comedy is revealed in a new book to be published on Monday, Last Of The Summer Wine: The Story Of The World's Longest Running Comedy Series.
The Holmfirth-based show is being axed after 37 years and 31 series, to the disappointment of many fans.
The cast and crew did not know it would be the final outing for the programme when the episode - called How Not To Cry At Weddings - was filmed last year.
It will be screened on August 29.
The swansong line from the script refers to a running joke throughout the episode in which Clegg reflects on whether he locked up before leaving home to head to a wedding.
The show's creator Roy Clarke said recently that the show had reached a natural end.
"The timing is right because we're all getting so doddery," he said. "'All good things must come to an end' is a cliche but it's true."
The book, by assistant editor of The Yorkshire Post Andrew Vine, is published by Aurum Press.