So I've been wondering how to run these two lines of code everytime I close an open instance of Terminal:
history -c cat /dev/null > ~/.bash_history
export HISTFILE=5 on startup, but still want to flush that out when I'm done.
I run Linux Mint, and would also note here that I ran into a similar issue with
.bash_profile; eventually, I discovered I needed to place all start up code in
.bashrc, so maybe that has something to do with it. Here's my
#!/bin/bash # ~/.bash_logout: executed by bash(1) when login shell exits. #this does nothing on exit... echo 'logout'; sleep 2s # when leaving the console clear the screen to increase privacy if [ "$SHLVL" = 1 ]; then history -c cat /dev/null > ~/.bash_history [ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q fi
I've tried re-arranging this script many ways, I'm not sure if I don't understand how bash works, and if any of this is running in the first place. Does the fact that I run
Xserver make bash consider Terminal something that isn't a log-out on exit?
It does say that I am not logged in, which would make sense:
$> shopt login_shell login_shell off