We don't know
This sword is never mentioned in the books, so my answer will be completely non-canonical.
Films
In The Fellowship of the Ring, Aragorn uses it to fight and defeat the nine Ringwraiths. Later at Amon Hen, Frodo and Aragorn discovers Frodo's sword, Sting turns blue, signaling the Orcs had arrived. Then Aragorn and the fellowship fight off the Uruk-hai attack, allowing Frodo to escape in the confusion. Aragorn then uses it in the ensuing skirmish.
In The Lord of the Rings: The Two Towers, it was finally used in Battle of the Hornburg to defend Rohan, after which it was never seen again, because he revealed himself to Sauron as the king returned, via a Palantír brandishing Anduril, the Elves had reforged it from Narsil.
It is unknown what happened to the sword afterwards, it was possibly abandoned by Aragorn.
This is a fairly accurate summary of the use of Aragorn's Ranger Sword by Lord of the Ring Fandom Wikia.
Books
The only weapon Aragorn kept when he met Frodo and Co. were the shards of Narsil. This Ranger Sword never appears.
'I did not know,' he answered. 'But I am Aragorn, and those verses go with that name.' He drew out his sword, and they saw that the blade was indeed broken a foot below the hilt. 'Not much use is it, Sam?' said Strider. 'But the time is near when it shall be forged anew.'
He reforges Narsil into Andúril before he leaves with the Fellowship.
The Company took little gear of war, for their hope was in secrecy not in battle. Aragorn had Andúril but no other weapon, and he went forth clad only in rusty green and brown, as a Ranger of the Wilderness.
Why didn't just give it to anyone like Eomer, Theoden or any man of Gondor or Rohan?
They already had their own swords. They didn't need another one. Even if Aragorn did give his sword away, we wouldn't know: the sword was never brought up again in the films (or the books).