hi i dont know much about perl so im hoping someone can help me.
i have a billing system that creates users on a linux mail server with a perl script. the billing system passed 2 values, the username and password to the script.
the script creates the username and places the users's home fir in /home/$username.
what i want to do is have it place the user in /home/1st letter of username/$username. I would like the home dir letter never to be in caps.
the pl script im using has these lines
#!/usr/bin/perl
open(INFILE, "@ARGV[0]");
$infile = <INFILE>;
($username,$password) = split(/\|/, $infile);
close(INFILE);
@calladduser = ("/usr/sbin/adduser $username -g 503 -d /home/$letter/$username -s /sbin/nologin -p $password","\n");
system("@calladduser");
@cryptpasswd = ("echo $password | passwd $username --stdin");
system("@cryptpasswd");
what can i do on this script that will place the 1st letter of the username in $letter.
Thanks for all your help.
i have a billing system that creates users on a linux mail server with a perl script. the billing system passed 2 values, the username and password to the script.
the script creates the username and places the users's home fir in /home/$username.
what i want to do is have it place the user in /home/1st letter of username/$username. I would like the home dir letter never to be in caps.
the pl script im using has these lines
#!/usr/bin/perl
open(INFILE, "@ARGV[0]");
$infile = <INFILE>;
($username,$password) = split(/\|/, $infile);
close(INFILE);
@calladduser = ("/usr/sbin/adduser $username -g 503 -d /home/$letter/$username -s /sbin/nologin -p $password","\n");
system("@calladduser");
@cryptpasswd = ("echo $password | passwd $username --stdin");
system("@cryptpasswd");
what can i do on this script that will place the 1st letter of the username in $letter.
Thanks for all your help.