I'm not positive Hannibal fits into that list, but in any case both the Classical Greek and the later Hellenic Successor traditions did put the commander in the frontlines. In the latter it was really also a question of battlefield C-and-C in an era when communications were largely down to shouting - with the head guy at the tip of the elite shock force, he had a hands-on direct control of the (hopefully) decisive mobile strike element. The pike line, after all, could usually be assumed to do its lineholding part without senior supervision.

And most "barbarian" leaders were AFAIK expected to set an example and demonstrate that their bravery and mettle were at least the equal to any of their followers. This was probably also a major reason why Classical Greek generals normally fought as a part of the hoplite phalanx - sort of showing their men they weren't asking anything they were not willing to do themselves, and of course the norms of courageous and glorious combet (ie. as a hoplite) of the time.

Both the Romans and Achaemenids at least had a more "restrained" approach, where the senior commander primarily directed his troops from the rear. That both made a lot of use of tactical reserves, making the timing of their committement important, probably had something to do with that. Although as the commanders of both tended to be accompanied by a force of picked heavy cavalry it wasn't all that unusual for them to get stuck in at one point or another (leading reinforcements into a trouble spot for example), and didn't for example Cyrus the Younger get himself killed in hand-to-hand combat at Cunaxa ?