utils.sh: bash utility functions