1#============================================================================= 
 2#
 3#  FILE NAME
 4#
 5#     .bash_logout
 6#
 7# DESCRIPTION
 8#
 9#     bash shell executed upon logout.
10#     Install into your home directory ~.
11#
12#  DATE
13#
14#      24 Aug 24
15#
16#  AUTHOR
17#
18#      Sean E. O'Connor
19#
20#============================================================================= 
21#
22# Clean up history.
23#
24rm -f ~/.bash_history
25#rm -f ~/.viminfo
26
27# Find out which operating system we are running on:  macOS, Linux, Windows/Cygwin, etc.
28uname=`uname -s`
29# We are running on Linux.  Tested on my Ubuntu Linux system running on my Cyperpower PC with a 64-bit AMD CPU.
30if [ "${uname}" == "Linux" ] ; then
31    # When leaving the console clear the screen to increase privacy.
32    # See https://unix.stackexchange.com/questions/451069/why-is-there-a-call-to-clear-console-in-bash-logout
33    # Do this by checking the level of subshell.
34    if [ "$SHLVL" = 1 ]; then
35        [ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q
36    fi
37fi