Wednesday, July 14, 2010

never feel the need again to source .bashrc

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

#RSFtalks with Edward Snowden

What an intelligent, thoughtful individual. I find it difficult to forgive 44 for failing to pardon this patriot and instead pursuing him ...

Other Popular Posts: