Logging Out

Contents:
Running Commands When You Log Out
Running Commands at Bourne/Korn Shell Logout
Electronic Fortune Cookies
Automatic File Cleanup
Stop Accidental C Shell Logouts
Stop Accidental Bourne Shell Logouts
Detaching a Session with screen
What tty Am I On?

Running Commands When You Log Out

Is there something you want to do every time you log out: run a program that deletes temporary files, asks you a question, or prints a fortune to your screen? If you use the C shell, make a file named logout () in your home directory and put the commands there. Before a login C shell exits, it'll read that file. But not all shells are login C shells; you might want these shells to read your logout-type file, too. Articles and have some suggestions.

Some ideas for your logout are:

If you connect to this host over a network, with a slow modem or on a data switch - and you don't see all the logout commands run before your connection closes - try putting the command sleep 2 () at the end of the file. That makes the shell wait two seconds before it exits, which gives output more time to get to your screen.

- JP