preexec and precmd hook functions for Bash in the style of Zsh. They aim to emulate the behavior as described for Zsh.