bash functions and utilities