Unify bash utility functions