If I do
sudo zsh, I can tell I am in zsh by examining
Is there an easier way?
echo $SHELL says it's
/bin/sh, because $SHELL is always the default shell, not necessarily the shell that's actually running.
If I happen to be on some interactive shell, and just want to quickly verify what kind of shell it is, I usually do a
If I'm in zsh, I get
zsh: parse error near `)'
, bash says
bash: syntax error near unexpected token `)'
and dash and ash also reveal their name in this way. I guess that this approach would also work with csh, tcsh and ksh.