Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Beginners > deleting a user...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 4 Topic 11045 of 11065
Post > Topic >>

deleting a user name from a file

by lokeey@[EMAIL PROTECTED] (Lokeey) May 9, 2008 at 07:35 AM

------=_Part_3292_26925685.1210336503266
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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."

------=_Part_3292_26925685.1210336503266--




 4 Posts in Topic:
deleting a user name from a file
lokeey@[EMAIL PROTECTED]   2008-05-09 07:35:03 
Re: deleting a user name from a file
rob.dixon@[EMAIL PROTECTE  2008-05-09 18:56:35 
Re: deleting a user name from a file
rob.dixon@[EMAIL PROTECTE  2008-05-09 20:40:00 
Re: deleting a user name from a file
lokeey@[EMAIL PROTECTED]   2008-05-09 13:49:13 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed May 14 14:56:17 CDT 2008.