improvements from https://github.com/GNU-Pony/bash.d