shell functions for both bash and zsh