export BASHRC_MTIME=`stat -c%Y ~/.bashrc`
auto_update() {
if [ ! $BASHRC_MTIME ] || (( "`stat -c%Y ~/.bashrc`" > $BASHRC_MTIME )); then
source ~/.bashrc
fi
}
PROMPT_COMMAND=auto_update
of course this comes at some cost - a call to stat() every prompt.
No comments:
Post a Comment