Lee Holmes, 46, of Burford, Brookside, had been a regular customer at the Premier Store in Burford, Shrewsbury Crown Court heard.
He was jailed for two years and told he was have to serve half the sentence before release on licence after admitting robbery and possession of a bladed article at an earlier hearing.
Judge Anthony Lowe told Holmes although he may not have planned to use the weapon, had the shopkeeper or an onlooker stepped in he might have injured or even killed someone out of panic.
Ms Sati Ruck, prosecuting, told the court that on the morning of January 4, Holmes went into the store where the shopkeeper was talking to a sale representative.
Holmes asked for a bottle of whisky and tobacco worth £28 and, when it was given to him he, said he would pay for it later whilst tapping something on the counter.
When the shopkeeper tried to take the whisky back, Holmes held up his hand, showing the knife and backed out of the shop.
The shopkeeper, who knew the defendant as a regular customer, contacted the police.
Holmes was arrested at his home soon afterwards and the knife was found on a table.
Mr Adrian Roberts for Holmes said his client had reached an all-time low in his life.
"He had been drinking and taking drugs and had stopped taking his medication,” he said,
"This was a hopeless crime committed in a haze. He has let himself down.”
Judge Lowe added: "I dare say you are as mystified as the court as to how to come to be here on such a serious charge.
"There may not have been any intent to use the knife.
"However, there only needed to have been a gung ho bystander or in fact the shopkeeper to approach you.
"We could have had a fatality over a bottle of whisky and a tin of tobacco.”