Next script delete account in linux from a file
#! /usr/bin/perl -w
use strict;
my $i="";
my $FInput;
my @arrContas=();
if(@ARGV != 1)
{
{
print("Sintaxe: ./delete_Accounts.pl \n"); exit 1;
}
if(!open($FInput,"$ARGV[0]"))
{
{
print("Error reading the input file\n"); exit 1;
}
@arrContas=<$FInput>;
close($FInput);
for $i (@arrContas)
{
chomp($i);
`userdel --remove $i`;
print("Account $i sucessful deleted\n");
}
0 comentários:
Enviar um comentário