Even more bash wrangling