Run script before Bash exits -


i'd run script every time close bash session.

i use xfce , terminal 0.4.5 (xfce terminal emulator), run script every time close tab in terminal including last 1 (when close terminal).

something .bashrc running @ end of every session.

.bash_logout doesn't work

you use trap (see man bash):

trap /u1/myuser/on_exit_script.sh exit 

the command can added .profile/.login

this works whether exit shell (e.g. via exit command) or kill terminal window/tab, since shell gets exit signal either way - tested exiting putty window.


Comments

Popular posts from this blog

jQuery clickable div with working mailto link inside -

WPF: binding viewmodel property of type DateTime to Calendar inside ItemsControl -

java - Getting corefrences with Standard corenlp package -