I had the same issue. I had updated the order in which the new shell and user name appeared in the script as per the usermod command. It still did not work for me. I am sure I used the format
usermod -s $new_shell $user_name
I even skipped the variable name part and user the “Read Input” method but still did not work. Had to skip the last question
Please don’t forget to mention sudo before this command.
Input would be like this : bash update_shell.sh username shell
where the username will be “bob” & the shell name will be “/bin/bash”
Now in the script please make sure that you add sudo before the usermod
like this