The story
Ellipsis of can do nothing but hope or can do naught but hope.
Etymology from Wiktionary, CC BY-SA 4.0.
Today it means: To be unable to do anything (about something) other than hope [with that (+ clause); or (informal) with clause; or with so or (negative) not]; especially with long odds. Full definition →