In bash, can I arrange for a function to be executed just before running a command? There is $PROMPT_COMMAND, which is executed before showing a prompt, i.e., just after running a command. Bash's $PROMPT_COMMAND is analogous to zsh's precmd function; so what I'm looking for is a bash equivalent to zsh's preexec. Example applications: set your terminal title to the command being executed; automatic
![Does bash have a hook that is run before executing a command?](https://cdn-ak-scissors.b.st-hatena.com/image/square/1903ece89af850aed3e9777e774c51491b959a61/height=288;version=1;width=512/https%3A%2F%2Fcdn.sstatic.net%2FSites%2Fsuperuser%2FImg%2Fapple-touch-icon%402.png%3Fv%3De869e4459439)