LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   .bash_logout does not get executed (https://www.linuxquestions.org/questions/linux-newbie-8/bash_logout-does-not-get-executed-104906/)

nearfar 10-16-2003 07:23 PM

.bash_logout does not get executed
 
Hi,

I am using redhat 7.3. I want to run a script when i logout, to clean up some of the files, processes, etc. I realized that the .bash_logout file does not get executed at logout. Does anyone know how i can make it to execute each time i logout? I tried adding trap in the .bash_profile file (trap "/path/scrip" 0) but that didn't seem to work. I would really appreciate it if someone could help me.
Thank you!:confused:

unSpawn 10-16-2003 08:03 PM

I realized that the .bash_logout file does not get executed at logout. Does anyone know how i can make it to execute each time i logout?
Are you sure it *doesn't* get executed and it's not due to a fault in your logout script?
Adding a last line "echo "logout; sleep 2s" to your ~/.bash_logout should show if it really doesn't. ~/.bash_profile will only be executed on login by a login Bash or Sh shell.

nearfar 10-17-2003 10:35 AM

.bash_logout does not get executed. Also I can run my script manually without problem..any ideas?

quatsch 10-17-2003 11:40 AM

does it get executed when you do not use graphical login? I/e/ go to runlevel 3, and then login from there and see if logging out executes the script. Maybe the logging out inside X doesn't get treated as logging out.


All times are GMT -5. The time now is 05:25 PM.