[ale] screen blanking

Michael D. Ivey, RHCE ivey at gweezlebur.com
Thu Jul 16 11:29:06 EDT 1998


--Kj7319i9nmIyA2yE
Content-Type: text/plain; charset=us-ascii

On Thu, Jul 16, 1998 at 09:41:00AM -0500, Bob Kruger wrote:
> You're right - I did.
> 
> This worked like a champ.  Many thanks.  Now - the next question - how to
> make this happen without having to copy file .bash_logout or make a link
> into each home directory.  In otherwords, make this a single entry that is
> the default for all users on the system.

Well, the manpage for bash doesn't mention an /etc/bash_logout file, although
that would make sense.  My suggestion:
stick it in /etc/skel for new users, and run a sh/perl script to make the file
for each user.  10 minutes, tops.  If you're a perl hacker, that is...  =)

Here's a starter...no warranty, express or implied, YMMV.

/mdi

-- 
 Michael D. Ivey, RHCE | :r ~/doc/std_disclaimer.txt                         
-----------------------+-----------------------------------------------------
  ivey at gweezlebur.com  | "There's nothing wrong with sobriety in moderation."
 http://gweezlebur.com |                                        - John Ciardi

--Kj7319i9nmIyA2yE
Content-Type: text/plain; charset=us-ascii
Content-Description: feu: for each user
Content-Disposition: attachment; filename=feu

#!/usr/bin/perl

# usage:
# feu command
# use USER in command to substitute username in
# ie:
# # feu ls /home/USER
# ls on each user's homedir
# # feu echo 'clear' > /home/USER/.bash_logout
# add the logout message
# no warranty, express or implied
# Michael D. Ivey <ivey at gweezlebur.com>

@userlist=`/bin/ls -1 /home`;      
foreach $user (@userlist) {
    chop $user;
    $command = &make_command($user, at ARGV);
    system ("$command") if (
    ($user ne "lost+found") &&
    ($user ne "quota.user") &&
    ($user ne "quota.group") &&
    ($user ne "SOMEOTHERUSERSTOIGNORE")
    )
}
sub make_command {
    my ($user, @args) = @_;
    my $command, $arg;
    foreach $arg (@args) {
 	$arg =~ s/USER/$user/;
	$command = $command . " " . $arg;
    }
    return("$command");
}

--Kj7319i9nmIyA2yE--






More information about the Ale mailing list