A Dysart shopkeeper fought off two machete-brandishing raiders with a baseball bat hidden under his counter.
When police caught up with Liam Docherty (25), they found he had been released from prison just nine days earlier.
Accomplice John Young (24), was still on licence after early release from his last sentence and both men were on bail.
The High Court in Edinburgh heard last week that after tackling the two would-be robbers and chasing them from the Fife convenience store shopkeeper Raheem Aslam (26), was plagued by stress and sleeplessness.
He was now afraid to have his family in the shop in High Street, Dysart.
Jailing the raiders for a total of more than nine years, judge Lord Uist told them: “Lawless conduct of this nature cannot be tolerated and must be severely punished.”
Advocate depute Andrew Brown QC described how Mr Aslam was already wary of Docherty and Young because they were new to the area and had been in the shop frequently during the two weeks before the robbery attempt.
Mr Brown said during this time the two men were planning the raid and Young had asked his girlfriend to buy two decorative knives.
About 7.00 p.m. last October 30 a passing driver noticed the two men outside the Tower Stores premises.
“His attention was drawn to them as they were both wearing dark clothing and blue surgical gloves and their faces were covered,” said Mr Brown.
One of the men was hiding a large knife down the back of his trousers.
Mr Aslam, who had run the family business for six years, was alone in the shop when the two raiders entered, machetes in hand and wearing balaclava masks.
“Both stood in front of the counter brandishing their weapons,” said Mr Brown.
Mr Aslam was ordered to fill a holdall with money.
“Do it or I will kill you,” yelled Docherty.
Mr Brown said Mr Aslam bent down to pick up the green camouflage bag but instead picked up the hidden baseball bat.
Mr Aslam told Docherty: “I ken who you are. You’re the guy that stays in the B and B. I’m gonna take that balaclava off your head.”
Docherty turned to Young and shouted: “C’mon, Let’s go” and the two raiders fled empty handed.
In court they pleaded guilty to assaulting the shopkeeper, threatening to kill him, and attempting to rob him.
Both men have lengthy criminal records, the court heard, linked to their abuse of drugs. Young was desperate to pay off a drug debt, said solicitor advocate Iain Paterson, defending.
Docherty had grown up in a house where his mum took drugs and had turned to drugs himself at a very early age said solicitor advocate Krista Johnston.
Docherty was awaiting sentence for theft and had been released on October 21 to see if he was suitable for a drug treatment and testing order.
Young, who had been living in Dysart’s High Street, close to the shop, had been freed on August 13 from sentences he was serving for possession of a knife and possessing diazepam.
Lord Uist ordered him to serve 14 months remaining from the previous sentence before begining a five year term for the robbery attempt.
Docherty was jailed for four years and four months.
The judge told them: “This was clearly a planned crime, although you did not succeed in carrying out the intended robbery.
“Shop worker Mr Aslam must have been terrified by your conduct.”