Hi guys, I keep getting errors on the followin script.
I need the script to logout all users other then root
or ipl.

     1  #!/usr/bin/perl
     2  #
     3  #Purpose: To logout users off the system
during after hours.
     4  #
     5  open(STDERR,">/tmp/userlog.log") || die $!;
     6  select (STDERR);
     7  open(USERS, "/tmp/usersin") || die "can't open
the USERS file: $!\n";
     8    while (<USERS>) {
     9          $user=split(//);
    10           #  chomp $user;
    11              print "$user\n";
    12                  # @user="root","ipl";
    13                    if ($user eq root || $user
eq ipl) {
    14                   # chomp $user;
    15                    print "user will NOT be
logged out \n";
    16                                                
   }
    17                    elseif
    18  # chomp $user;
    19  @PIDS=`ps -ef | grep $user | grep -v grep |
cut -b 10-14`;
    20                    while (<@PIDS>){
    21                            `kill $PIDS`;
    22                            `kill -9, $PIDS`;
    23                                 }
    24   close (USERS);
    25   close (STDERR);
"logout.pl" 25 lines, 798 characters 
root@kerouac/export/shareux 372 >perl -w logout.pl
"root" may clash with future reserved word at
logout.pl line 13.
"ipl" may clash with future reserved word at logout.pl
line 13.
"elseif" may clash with future reserved word at
logout.pl line 17.
syntax error in file logout.pl at line 19, next token
"@PIDS"
syntax error in file logout.pl at line 26, at EOF
Execution of logout.pl aborted due to compilation
errors.



=====
Peter Lemus
UNIX/NT Networks Engineer
[EMAIL PROTECTED]

--This world is too big for us to be alone.
--A wise man will be master of his mind a fool will be its slave.

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

Reply via email to