A euphemism for the devil.

1

1839.  What in sam hill is that feller ballin’ about?—‘Major Jack on a Whaler,’ Havana (N.Y.) Republican, Aug. 21.

2

1868.  He had bought him a little bob-tailed, mouse-colored mule, and was training him like Sam Hill.—Leavenworth (Kas.) paper, quoted in ‘Following the Guidon,’ p. 142 (1890) (N.Y.).

3

1909.  How in Sam Hill can she do it? She’s just as hot when she gets to bilin’ p’int as she’ll ever be.—N.Y. Evening Post, April 12.

4