Hey all,

Just a quick question I want to be able to a line from /etc/passwd and
append it to the end of /etc/shadow.  So far I have the following.

#!/usr/bin/perl -w

my $passwdFILE = '/etc/passed'; #System password file
my #shadowFILE = '/etc/shadow';
my $user = 'test'; #User details to be moved accross from /etc/passwd to
/etc/shadow

open FILE, "$passwdFILE"  or die "Cannot open $passwdFILE in for reading
ONLY:$!";
my @lines = <FILE>;
if ( $line->[3] == 45 && $array_ref->[0] =~ /^$user/ ) {
#open /etc/shadow for appending..
        open SHADOW, ">>$shadowFILE"  or die "Cannot open $passwdFILE in
for reading ONLY:$!";
        #what to go here?
}

Any help here would be greatly appriciated.

Dan

==============================
VINTEK CONSULTING PTY LTD
(ACN 088 825 209)
Email:  [EMAIL PROTECTED]
WWW:    http://www.vintek.net
Tel:    (08) 8523 5035
Fax:    (08) 8523 2104
Snail:  P.O. Box 312
        Gawler   SA   5118
==============================


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to