·What do you want to do
I installed zsh on CentOS 7 on vagrant with reference to https://qiita.com/d-dai/items/084cace7f6bfd3580f9d.And I confirmed that the path of zsh (/usr/local/bin/zsh) can be run directly.
I want to switch the default boot shell from bash to zsh.
·Problems
To change the boot shell, use the
#echo/usr/local/bin/zsh>>/etc/shells
# chsh-s/usr/local/bin/zsh
I ran , but then exec$SHELL-l
did not start zsh and bash started.
The result of echo$SHELL
remained /bin/bash
.
How can I switch the boot shell successfully?
add
It was resolved by logging in again with vagrant ssh
after exiting once.
Thank you for your reply.
You cannot rewrite environment variables (such as $SHELL
) for another process from one process (such as $SHELL
), so you can rewrite the file or run commands such as chsh
(1) to keep the existing login shell process $SHELL
.If you want to switch interaction shells without logging out, do export SHELL=/usr/local/bin/zsh
and then exec $SHELL-l
or exec env SHELL=/usr/local/bin/zsh/usr/local/bin/zsh-l
.
618 Uncaught (inpromise) Error on Electron: An object could not be cloned
581 PHP ssh2_scp_send fails to send files as intended
611 GDB gets version error when attempting to debug with the Presense SDK (IDE)
915 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
© 2024 OneMinuteCode. All rights reserved.