Skip to content

Instantly share code, notes, and snippets.

@Drakonite
Drakonite / preexec.bash
Created March 22, 2013 16:07
preexec.bash -- Bash support for ZSH-like 'preexec' and 'precmd' functions. The 'preexec' function is executed before each interactive command is executed, with the interactive command as its argument. The 'precmd' function is executed before each prompt is displayed.
#!/bin/bash
# preexec.bash -- Bash support for ZSH-like 'preexec' and 'precmd' functions.
# The 'preexec' function is executed before each interactive command is
# executed, with the interactive command as its argument. The 'precmd'
# function is executed before each prompt is displayed.
# To use, in order: