An Auchterarder man ripped off his clothing before charging at a couple as they walked to the shops.
James Brown had begun abusing Lauren Kennedy and Caileon Ward as he drove past them in his van.
The 29-year-old then followed them into the shop where he launched an attack in which Ms Kennedy and the shop keeper, Sabeel Qadir were assaulted.
Despite fiscal Mairi Graham told Perth Sheriff Court: “It was 4.40pm and Mr Ward and Ms Kennedy were walking together down King Street towards the store.
“They saw a van drive past and the accused leaned out and began shouting abuse at them, stating ‘I’m going to murder you’. The witnesses ignored this but the accused exited the vehicle and continued the abuse before tearing off his t-shirt, throwing it to the ground and running towards them.
“They entered the store to avoid him but he followed them.”
She said the accused had challenged the pair to come back outside but they had refused.
She continued: “There was an attempted punch which made contact with Ms Kennedy. Mr Qadir heard her screaming.
“Mr Qadir asked him to leave but the accused pushed him into a wall, calling him a black b*****d and a P**i.
“He then left but returned so police were contacted.”
Brown later told officers that he was aiming for Mr Ward when he hit Ms Kennedy.
Solicitor Paul Ralph, defending, said: “He and Mr Ward are known to each other. That is the reason for Mr Brown’s behaviour, not that it excuses the incident.
“Mr Brown is contrite about his behaviour, particularly towards Ms Kennedy and Mr Qadir.”
Brown, of Southlands Road, Auchterarder, admitted behaving in a threatening and abusive manner by shouting, swearing, uttering threats of violence and making racist rememrks on Crieff’s Kong Street and in the town’s A&A Stores on August 17.
He further admitted assaulting Lauren Kennedy and Sabeel Qadir.
Sheriff Keith O’Mahoney said: “This was clearly an ugly incident and must have been alarming for those involved and is aggravated by the fact that you made racist remarks during this incident. That’s not to be tolerated in this day and age.”
He ordered Brown to carry out 150 hours of unpaid work and placed him on a 12 month supervision order. He also ordered him to undergo treatment for alcohol issues.