Some bash utility functions