Bash "library" functions, used by various scripts