A Lidl shopper was terrified when she spotted a man wielding a seven-inch knife outside the store in broad daylight, a court heard.
Andrew Farrens admitted having a weapon when he was spotted by the South Road shopper.
Depute fiscal Eilidh Robertson told Dundee Sheriff Court: “At 12.15pm on Saturday January 16 a 29-year-old female was shopping in Lidl when she spotted the accused outside with two males.
“She saw him lift his shirt and he had the knife tucked into the waistband of his trousers.”
The court heard how the South Road Lidl customer saw Farrens follow the pair before he took the knife out of his trousers, held it in his hand for 10 seconds then threw it into some undergrowth.
When police traced Farrens they found him under the influence of drugs, the court heard.
Farrens, 26, a prisoner at Perth, pleaded guilty to having the knife in a public place on Coupar Angus Road on January 16.
Defence solicitor Jim Caird told the court: “It wasn’t an argument. It was a discussion with friends outside the shop.
“He was seen on CCTV and there was no intervention from the authorities. He did throw the knife away.”
The court heard Farrens has previous convictions for assault, possession of weapons and drugs offences.
Sheriff Tom Hughes said: “A custodial sentence is inevitable because of your previous convictions.”
He was jailed for a year, although the sentence was backdated until January 18 when he was remanded in custody.