by a hair

[by a hair] See: HANG BY A THREAD or HANG BY A HAIR