bash-preexec

Bash library providing preexec and precmd hook functions

brewmacoslinux
Try with needOr install directly
Source

About

Preexec and precmd functions for Bash (like Zsh)

Commands

bash-preexec

Examples

Source the library in your .bashrc to enable preexec/precmd hooks$ source /usr/local/opt/bash-preexec/bash-preexec.sh
Define a precmd function to run before displaying the prompt$ precmd() { echo 'Prompt about to be shown'; }
Define a preexec function to run before command execution$ preexec() { echo 'About to run: $1'; }