common functions for bash