Although the expression “to shake a stick at” does have a literal meaning, to threaten with a stick, we in the United States give it much more fanciful interpretations.
If we say, “There are more filling stations in town than one can shake a stick at,” we mean nothing more than that the town contains an abundance of places at which one may purchase gasoline for one’s motorcar.
That American usage dates from early in the nineteenth century.
One may speculate that it arose from the play at warfare by small boys, George Washington Jones flourishing a triumphant wooden sword over the considerable number of British soldiers who surrendered at Yorktown, more, in fact, than he could wave his “stick” at.
Then, too, we use the expression to indicate a comparative that may express derogation, and have done so for well over a hundred years.
David Crockett, in his Tour to the North and Down East (1835), wrote of one place at which he stayed, “This was a temperance house, and there was nothing to treat a friend to that was worth shaking a stick at.”