I want to create a user with adduser command and then set up its password using passwd command.
I want to specify the group, home directory and gecos for the user and then set up the password for the user using passwd command.
If I have stored string values for username, group, home directory, gecos, password in variables un, grp, hd, g and pd respectively, how can I use adduser and passwd commands to create a user with specified information. I know there's another command "useradd" but I want to use "adduser" at this point. How to do this in a shell script?