a few bash functions