Created
June 20, 2016 05:06
-
-
Save spchamp/520456dbd609566f6aa18048f09d9a88 to your computer and use it in GitHub Desktop.
.bash_logout
This file contains 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
# .bash_logout -*- sh -*- | |
if [ -n "$SSH_AGENT_PID" ] && | |
[ "$(ps -p $SSH_AGENT_PID -c -o comm | sed 1d)" = ssh-agent ] && | |
[ "$(ps -U $USER -c -o tty | sed 1d | grep -v "^-" | sort | uniq)" -eq 1]; | |
## Do not enter this branch of control flow | |
## if user is logged in under another PTY/TTY | |
then eval $(ssh-agent -k) | |
fi | |
## source: debian skel ${HOME}/.bash_logout | |
## logic: check BASH $SHLVL before xclearchars(...) | |
if [ "$SHLVL" = 1 ]; then | |
## dep: debian clear_console binary - source, Debian 'bash' package (?) | |
# [ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q | |
## dep: BSD Logic | |
clear | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment