-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.bash_logout
More file actions
27 lines (22 loc) · 748 Bytes
/
.bash_logout
File metadata and controls
27 lines (22 loc) · 748 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# ~/.bash_logout: executed by bash(1) when login shell exits.
# Stop trunk on out
trunk daemon shutdown
# Gabo backup history
\cp ~/.bash_history ~/.bash_history.bkp
if [[ "$(stat -c%s ~/.bash_history.bkp)" -gt "$(stat -c%s ~/.bash_history.bkp.safe)" ]]; then
cp ~/.bash_history.bkp ~/.bash_history.bkp.safe;
else
for run in {1..10}; do
echo -e "\n\n .safe history not copied, please CHECK... \n\n"
done
sleep 15
fi
# Gabo save directory on exit
if [[ ! "$(pwd)" == *"VS Code"* ]];then
echo "LOGOUT PWD $PWD"
pwd | sed 's/ /\\ /g' > ~/.lastdirectory
fi
# when leaving the console clear the screen to increase privacy
if [ "$SHLVL" = 1 ]; then
[ -x /usr/bin/clear_console ] && /usr/bin/clear_console -q
fi