-
-
Save wsvn53/83aedba0dddaec2ca822 to your computer and use it in GitHub Desktop.
Reload your bash profile in all open bash instances
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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_profile() { | |
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