#!/bin/bash echo "Type in your username in lowercase letters" read user #sudo adduser $user echo "Are you a student or teacher?" read group if (("$group"=="teacher")); then #sudo usermod -aG teachers echo "teacher" elif (("$group"=="student")); then #sudo usermod -aG students echo "students" else echo "Sorry this group doesn't exist" fi
I'm trying to make a shell script that allows me to create a user and then automatically add it into a group that they want to be in. The input is either a student or a teacher although i want to include these statements above but i can't seem to make it work because it just goes to to the 'if' statement and ignores if i use the input student.
Could you please help me with this problem?