I am trying to add Xonsh to my /etc/shellsto make it my new default shell, however when i run sudo which xonsh >> /etc/shells I get bash: /etc/shells: Permission denied I tried changing the permissions using chmod u+x /etc/shellsbut it throws changing permissions of '/etc/shells': Operation not permitted what can i do?
Asked
Active
Viewed 599 times
1
ᄂ ᄀ
- 4,187
Omar Morales Rivera
- 137
- 5
1 Answers
1
The output redirection >> is perhaps tried to be applied
by the shell before the sudo is executed, but the
user shell has no permission to do that.
To avoid the error, the following two formulations might work :
sudo sh -c "echo $(which xonsh) >> /etc/shells"
echo $(which xonsh) | sudo tee -a /etc/shells
harrymc
- 498,455