LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   how t have a command launched when ever i logoff (http://www.linuxquestions.org/questions/linux-general-1/how-t-have-a-command-launched-when-ever-i-logoff-929406/)

Knightron 02-15-2012 01:12 AM

how t have a command launched when ever i logoff
 
Hello, i would like a command to be launched so i can remove some catch files, when ever i logoff. How does one go about doing this?

fukawi1 02-15-2012 01:17 AM

This will probably vary between distro and shell..
But with bash, creating a script and calling it from ~/.bash_logout, and(or) /etc/bash_logout should work.

Knightron 02-15-2012 02:40 PM

yes I am using bash. thanks for your help. will this work every time I logout on the GUI?

PDock 02-15-2012 03:51 PM

My experience was this did not work if your system directly [ie run level 4] boots a gui login. If you use startx after login then close the window manager and logout via bash it works fine. Now this was at least six years ago.


All times are GMT -5. The time now is 07:20 AM.