I have modified the script as shown below but cannot get it to pass. Can you please advise how I can resolve this.
new_shell=$1
user_name=$2
usermod -s $new_shell $user_name
Kindly provide us with the question number.
Question 6. The script in the question is not working. So the changes I made were making
new_shell=$1; user_name=$2 .
I also re-ordered $new_shell and $user_name in the usermod command. I looked up the use of usermod from the linux training and seen that in tthe syntax the new shell directory is immediately after usermod -s .
To resolve this quickly, please send me the syntax correction so the script can work and I will test it and take note of your provided correction.
Thanks
The only syntax that must change in this exercise that
usermod [options] username
So you must change the line to :
usermod -s $new_shell $user_name
And it will work fine.
The complete script would be as below:
new_shell=“$2”
user_name=“$1”
usermod -s $new_shell $user_name
Hope this helps!