Green’s Dictionary of Slang

damn! excl.

also by damn!
[abbr. damnation! excl.]

[18C+] an all-purpose profanity, used in a wide variety of contexts.

In exclamations

damn-but! (also dambut!)

[1930s+] (Irish) an excl. of affirmation.

damn Sam! [assonance]

[1950s] (US black) an excl. of surprise or annoyance.