“He claimed to have taken 28 Valium tablets and had been in the homeless unit since the end of April.”

Defence lawyer Ian Smart said: “For someone of his young years he has a spectacularly bad record, which includes an appearance in the High Court.

“He readily concedes he has a problem with Valium and alcohol.”

Jailing Duffy, Sheriff Frank Pieri told him: “I have listened carefully to everything that has been said on your behalf, but the fact remains it was only by luck that you did not subject that man to a much more serious injury.

“You have a terrible record for crimes of violence.

“There is only one way I can deal with this and that is by a custodial sentence.

“If it had not been for your early plea you would have been sentenced to 21 months, but I will discount the sentence to 15 months.”

Duffy denied behaving in a threatening or abusive manner, causing fear and alarm and shouting and swearing.

It had been alleged he had carried out the offence on the same day at both the homeless unit and at Monklands Hospital. His plea of not guilty was accepted by the Crown.

Duffy’s sentence was backdated to September 7, when he was first remanded in custody.