lyadmin/perl-script/user_cleanup.pl

21 lines
278 B
Perl
Raw Normal View History

#!/usr/bin/perl
use warnings;
use strict;
my $fn;
my $cmd_out;
$fn = "/tilde/lyadmin/user_list.txt";
open FILE, "<", $fn or die "could not open $fn";
$cmd_out = `ls /home`;
chomp $cmd_out;
while(<FILE>){
chomp;
`userdel $_` unless($cmd_out =~ /$_/);
}
close FILE;