I have written a shell script which allows me to create a user and assign them to a group but I keep getting the error
line 19: syntax error: unexpected end to file
What am I doing wrong? Would it be possible someone could help me re structure the code to eliminate this problem.
Here is my shell script.
#!/bin/bash username="U" group="G" while [ $username"U" ] >/dev/null 2>&1; read -p "Please input the username you would like to generate" if id -U $username >/dev/null 2&1; echo 'User already exists" while [ $group >dev/null 2>&1; echo "group exists" else groupadd $group fi