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

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -