2 accounts of this passage
1 Kings 2:1–12
1As David's life was coming to an end, he gave these instructions to his son Solomon: 2"I'm about to die, as everyone must. Be strong and prove yourself a man. 3Obey the charge of the LORD your God by walking in His ways and keeping His statutes, commandments, judgments, and testimonies, as written in the law of Moses. This will ensure you prosper in all you do and wherever you go. 4Then the LORD will keep the promise he made to me: 'If your descendants are careful to walk faithfully before me with all their heart and soul, you will always have a man on the throne of Israel.' 5You also know what Joab son of Zeruiah did to me, and what he did to the two commanders of Israel's armies, Abner son of Ner and Amasa son of Jether. He killed them during peacetime, shedding the blood of war and putting the blood of war on his belt around his waist and in his shoes on his feet. 6Therefore, act according to your wisdom, and do not let his gray head go down to the grave in peace. 7But be kind to the sons of Barzillai the Gileadite and let them eat at your table, because they stood by me when I was fleeing from your brother Absalom. 8"Then there's Shimei son of Gera, the Benjamite from Bahurim. He cursed me viciously the day I fled to Mahanaim. But when he came down to meet me at the Jordan, I swore to him by the LORD, 'I won't put you to death with the sword.' 9Don't let him go unpunished. You're a wise man — you'll know what to do. Make sure his gray head goes down to the grave in blood." 10So David died and was buried in the city of David. 11The days that David reigned over Israel were 40 years: he reigned 7 years in Hebron and 33 years in Jerusalem. 12Solomon then took his place on the throne of his father David, and his kingdom was firmly established.
