basename $SHELL On Fri, 6 Sep 2019 at 16:41, Peng Yu wrote: > Suppose that I start with bash default login shell, then I call zsh. > > I'd like to determine whether I am in bash or zsh. I see ZSH_* > environment variables. Is ZSH_VERSION the most appropriate to be used > to test whether it is in zsh or not? Thanks. > > $ declare -p BASH_VERSION > declare -- BASH_VERSION="5.0.0(1)-release" > $ declare -p ZSH_VERSION > typeset ZSH_VERSION=5.6.2 > > -- > Regards, > Peng >