I want to create a new user in a specific group when I issue the below command.
sudo ./create_user.sh "test" "firstname lastname"
The create_user.sh
script looks as below.
#!bin/bash
#sudo adduser --gecos "$2" --ingroup testgroup $1
However, the problem is, I have to avoid the password insertion (it should be simply test) with a here document, but I have no idea about the syntax.
I tried some solutions but none of them seemed to work.
This is how my Try to of the heredocument in the script looks like
#<< EOF
#test
#test
#EOF
my output looks like this
#adding user 'test' ...
#adding new user 'test' <1003> with group 'testgroup' ...
#Enter new UNIX password: