i'm new to scripting in unix and am trying to make a script to add a user and an encrypted password for them. this is what i have and it isn't giving me any errors, but when i try to login with the new user, the password doesn't work. i'm hoping someone can point me in the right direction
#!/bin/sh
echo Enter First and Last name:
read fullname
echo Enter Username:
read username
echo Enter Password:
read password
sudo useradd -c "$fullname" -m -s "/bin/bash" -p `makepasswd --string "$password" --crypt-md5 | awk -F$ '{print "$" $2 "$" $3 "$" $4}'` "$username"