An armed robber raided an off-licence with a plastic bag covering his face twice in three days.
Ross Cummins, 31, had only been out of prison for a day when he carried out the first raid on April 22.
It was followed by another on April 24, during which he threatened staff with a knife.
He carried a screwdriver in the first robbery and covered his face with a plastic bag both times.
Social workers said Cummins, who has nine previous convictions for assault and robbery, presents an imminent danger to the public.
Judge Johanna Johnston jailed Cummins for four and a half years at the High Court in Glasgow on Tuesday.
She told him: "You are a man with a dreadful record. You were only just out of prison when you committed these offences.
"You caused terror and severe injury to a member of the public. You are at imminent risk of causing serious harm to the public."
Cummins admitted two charges of assault and robbery at High Spirits in Edinburgh on April 22 and 24.
In the first raid he escaped with between £30 and £40 and in the second around £125.
During the first robbery a staff member at the shop suffered a partially dislocated kneecap when Cummins pushed a door at him while he tried to close it.
Defence counsel Matt Jackson said: "My client has only been out of prison for three weeks since 2013.
"He has a considerable drug addiction and had a difficult childhood marred by violence. He is desperate to change his ways."