I thought this was interesting; while David is in exile from Jerusalem while Absalom is usurping (2 Samuel 16, HCSB):
When King David got to Bahurim, a man belonging to the family of the house of Saul was just coming out. His name was Shimei son of Gera, and he was yelling curses as he approached. 6 He threw stones at David and at all the royal[af]servants, the people and the warriors on David’s right and left. 7 Shimei said as he cursed: “Get out, get out, you worthless murderer! 8 The Lord has paid you back for all the blood of the house of Saul in whose place you became king, and the Lord has handed the kingdom over to your son Absalom. Look, you are in trouble because you’re a murderer!”
9 Then Abishai son of Zeruiah said to the king, “Why should this dead dog curse my lord the king? Let me go over and cut his head off!”
10 The king replied, “Sons of Zeruiah, do we agree on anything? He curses me this way because the Lord[ag] told him, ‘Curse David!’ Therefore, who can say, ‘Why did you do that?’” 11 Then David said to Abishai and all his servants, “Look, my own son, my own flesh and blood,[ah] intends to take my life—how much more now this Benjaminite! Leave him alone and let him curse me; the Lord has told him to. 12 Perhaps the Lord will see my affliction[ai] and restore goodness to me instead of Shimei’s curses today.” 13 So David and his men proceeded along the road as Shimei was going along the ridge of the hill opposite him. As Shimei went, he cursed David, and threw stones and dirt at him. 14 Finally, the king and all the people with him arrived[aj] exhausted, so they rested there.
because the Lord hath said unto him, curse David; not by way of command, or a precept of his; for to curse the ruler of the people is contrary to the word and law of God, Exo_22:28, nor by any operation of his spirit moving and exciting him to it; for the operations of the Spirit are to holiness, and not to sin; but by the secret providence of God ordering, directing, and overruling all circumstances relative to this affair. Shimei had conceived enmity and hatred to David; God left him to the power of this corruption in his breast, opened a way in Providence, and gave him an opportunity of exercising it on him: it was not a bare permission of God that Shimei should curse David; but it was his will, and he ordered it so in Providence, that he should do it; which action was attended with the predetermined concourse of divine Providence, so far as it was an action; though, as a sinful action, it was of Shimei, sprung from his own heart, instigated by Satan; but as a correction and chastisement of David, it was by the will, order, and appointment of God, and as such David considered it, and quietly submitted to it.
So in short, here’s this guy, one of David’s enemies, who’s cursing him and throwing stones at him—the king of Israel and God’s anointed—and David’s response is not to cut off his head as his commanders would like, but, “The Lord told him to, so who can say, don’t do that.” And I think Gill is right, David is speaking of God’s sovereignty here, not an actual command, that this guy Shimei was just so lost in his selfishness, in God’s allowance, that David recognized the best course of action was just to let it go. Even though the persecution continued and it was exhausting, just to accept it as the providence of God and that perhaps God would bless him for it.