deleting a user name from a file

[email protected] (Lokeey)
Newsgroups perl.beginners
Message-ID <[email protected]>
I'm writing this script to remove users from a file, the sudoers file, to be
more specific.

Here is what I have so far, not sure where to go from here.

*#!/usr/bin/perl -w

# this script removes a user from sudoers file

my $sites = $ARGV[0];
my $user = $ARGV[1];

for my $site ($#ARGV[1]){
  open FILE, "$_/local/etc/sudoers" or die "cannot open sudoers for $sites:
$!";

print "Enter username you wish to remove from $sites sudoers.\n";

  while (<FILE>) {s/$_//}
  close FILE;
}*


-- 
"It's not what people call you, it's what you answer to."
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.