This needed some love.

My bash skills have gotten loads better recently.