• to hang by a hair, to hang by a thread
• it was a close shave, it was a narrow shave, that was a close call, that was a near go
• it was as near as dammit
• to escape by the skin of one's teeth
• within an inch of death
• by the skin of one's teeth, with the skin of one's teeth