Skip to content

Instantly share code, notes, and snippets.

@sullenfish
Forked from appden/reload.bash
Created March 28, 2011 12:29
Show Gist options
  • Save sullenfish/890383 to your computer and use it in GitHub Desktop.
Save sullenfish/890383 to your computer and use it in GitHub Desktop.
bash profile reload via Scott Kyle (aka appden)
# put this in your bash profile (change the line below if you use .bash_profile)
# refresh profile on USR1 signal
trap 'eval $(PATH= /usr/libexec/path_helper -s) && source ~/.profile' USR1
# send USR1 signal to all bash instances
reload() {
ps -xo pid,command | grep ' \-bash' | awk '{print $1}' | while read pid; do
kill -USR1 $pid
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment