3 ms·
I tend to use: alias reload="exec -l $SHELL" Which I copied from somewhere, I don't know how specific it is but maybe it helps someone :)
by yNeolh 6y ago
I tend to use:
alias reload="exec -l $SHELL"
Which I copied from somewhere, I don't know how specific it is but maybe it helps someone :)
- oefrha 6y agoUsing $SHELL is not great because it is not a reliable env var. It's only set for login shells, and if your login shell isn't zsh you'll get a different shell on this "reload". (A long time ago I had an account somewhere where my sysadmin didn't respond to chsh request for whatever reason, so my login shell remained /bin/bash while I actually used zsh day to day.) It can also be anything, really: export SHELL=/sbin/nologin # or /usr/sbin/nologin, or equivalent on your system exec -l $SHELL You want zsh, so just use zsh. As for -l, exec zsh -l and exec -l zsh both replace the current shell with a login zsh, so they are effectively the same.