The SHELL variable stores the parent shell for your session, which sometimes matches with your default login shell. The $SHELL is the parent shell which spawned the current session.
$ whoami
razvan
$ echo $SHELL
/bin/bash
$ zsh
% echo $SHELL
/bin/bash
$ chsh -s /bin/ksh razvan
$ echo $SHELL
/bin/bash
So, the SHELL variable ($SHELL) does not display always the default shell.
The system default shell is defined in /etc/default/useradd file and the user’s default shell is stored in the /etc/passwd file.
To change the default shell, use usermod or chsh.
Leave a Reply