bash to brittle; implement a proper conversion script