I'm trying to execute some code (let's call it login.java) when I log in and out of my linux machine. Is there any way to do this? I'm looking for perhaps a way to trigger the code? I've thought of just putting it in my .bash_login but preferably the code would launch on normal login, not when I start my terminal.

link|improve this question
feedback

migrated from stackoverflow.com Jun 20 '11 at 22:03

This question came from our site for professional and enthusiast programmers.

2 Answers

If you are using bash shell it doable. check out the man bash. .bashrc and .bash_logout

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.