Issue
I want automatically install zsh, when I run the command chsh. I have a prompt which ask password in input.
Password :
After enter the password i have a second prompt, which ask me a shell path.
Enter the new value, or press ENTER for the default
Login Shell [/usr/bin/zsh]:
I want into a bash script :
- run the command chsh
- For the first prompt, let the user type his password
- then enter /usr/bin/zsh in the second prompt
Thanks for help !
Solution
use the -s
option to specify the shell instead of prompting.
chsh -s /usr/bin/zsh
Answered By - Barmar