You're likely thinking of Yosemite Sam's iconic line: "Well, I'll be a son of a gun!" While it may sound like a curse, it's not considered vulgar in cartoon context.
Cartoons from Sam's era (1940s–50s) had stricter censorship. Violence and slapstick were allowed, but actual curse words were generally avoided.
So Yosemite Sam likely never actually said "hell" in a cartoon. He used "family-friendly" phrases conveying similar frustration/anger.