Code: Alles auswählen
python:/home/marco# cat userscript.pl
#!/bin/perl -w
use Crypt::PasswdMD5;
my ($PWD,$SDW);
open($PWD,">","passwd.temp") or die $_;
open($SDW,">","shadow.temp") or die $_;
my $uid=2000;
my $gid=100;
my $salt="gRzBrzLT";
while (<STDIN>) {
chomp;
++$uid;
my ($name,$name2,$login,$password)=split(/;/,$_);
my $encpassword = unix_md5_crypt($password,$salt);
print $PWD "$login:x:$uid:$gid:$fullname:/home/$login:/bin/false\n";
print $SDW "$login:$encpassword:$uid:0:99999:7:::\n";
}
python:/home/marco#
Code: Alles auswählen
python:/home/marco# cat schueler.csv | perl userscript.pl
Can't locate Crypt/PasswdMD5.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.4 /usr/local/share/perl/5.8.4 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at userscript.pl line 3.
BEGIN failed--compilation aborted at userscript.pl line 3.
python:/home/marco#
danke im vorraus
Marco