preexec and precmd functions for Bash (just like Zsh)