bash useful function.