Hi,
Is there anyway to find out what shell we are currently using?
For example, I logged in and issued the following command to check my current shell:
Code:
%echo $SHELL
/bin/sh
then I changed to bash by executing the following command and checked again as to what shell I changed to:
Code:
%bash
[devarish@m-net ~]$ echo $SHELL
/bin/sh
but I got the same output, i.e.
/bin/sh.
Whereas the entry in /etc/passwd says a different story:
Code:
[devarish@m-net ~]$ grep ^$USER /etc/passwd
devarish:*:68166:10:Devarishi Kumar Mahadeva:/home/devarish:/usr/local/bin/menu
[devarish@m-net ~]$
So, how can we make sure from within a shell script that at any particular time or while that script is executing as to what
shell the logged-in user is currently working in because
echo $SHELL reports the same output even when the user has changed to some other shell temporarily?
Please note that we are not issuing the
chsh command to change the shell permanently.