|
I have done a script, but it is based on shell script, and i want to convert it to perl. I am very new to perl.
This is my shell script
#!/bin/bash
echo -n "Enter your name : "
read username
echo -n "Enter your password : "
read password
pass=$(perl -e 'print crypt($ARGV[0], "password")' $password)
useradd -m -p $pass $username
And i want to change it to perl script
This is how i change it, but it does not work
#!/usr/bin/perl
print "Enter your name : \n";
$username = <STDIN>;
print "Enter your password : \n";
$password = <STDIN>;
$pass=$('print crypt($ARGV[0], "password")' $password)
system("useradd -m -p $pass $username");
PLease help me.
|