[K12OSN] Run a Shell Script @ Logoff

Dan Young dan_young at parkrose.k12.or.us
Mon Jun 14 18:18:45 UTC 2004

On Mon, 2004-06-14 at 11:07, Josiah Ritchie wrote:
> On Mon, 2004-06-14 at 13:42, Dan Young wrote:
> > > Just a quick one this time....
> > > as you have probably guessed from the subject, I would like to
> > > run a Shell Script when the user logs off of the system...
> > 
> > Edit the user's ~/.bash_logout file. Create one if it's not present.
> That's for individual users, but isn't there a place for all of them at
> once? Kinda a default bash_logout? I can't remember it's location, but
> I'm almost certain it's possible.

You could source an /etc/bash_logout as with bashrc. Put a default
.bash_logout in /etc/skel (doesn't Redhat already have one here that
"clear"s on logout?), and then just copy it out to existing users.

# Source global definitions
if [ -f /etc/bash_logout ]; then
        . /etc/bash_logout

# User-specific stuff goes here

Then change your /etc/bash_logout to suit.

Dan Young
Parkose School District

More information about the K12OSN mailing list