1748269 Members
3649 Online
108760 Solutions
New Discussion юеВ

Re: current shell

 
Davis Paul
Valued Contributor

current shell

Hi,
How can I understand in which shell I am presently working?
6 REPLIES 6
Geoff Wild
Honored Contributor

Re: current shell

echo $SHELL


Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Franky_1
Respected Contributor

Re: current shell

Hi Davis,

echo $SHELL gives you the actual shell. If you have opend another one e.g. ksh from there then you can type echo $$ and look for the named process id. It will give you the named shell information

Regards

Franky
Don't worry be happy
Shrikant Lavhate
Esteemed Contributor

Re: current shell

Also, if you want to see users startup shell then it can be viewed from last column in /etc/passwd file.
Will it remain a personal, if I broadcast it here!
spex
Honored Contributor

Re: current shell

The 'env' command will display exported environmental variables, including $SHELL.
Dennis Handly
Acclaimed Contributor

Re: current shell

You can also type a bogus command and typically the shell with give you its name:
ksh: dfsfsd: not found

(Unfortunately the scummy C shell doesn't.)

>Franky: type echo $$ and look for the named process

You can optimize this to: ps -fp $$
Davis Paul
Valued Contributor

Re: current shell

Thank you all.