How to recognize the Shell?

Hello All

I am working on Red Hat Enterprise Linux Server release 5.1 when I logged on to the shell and then write echo $SHELL it shows me the result /bin/bash
and when I write csh, the prompt changes and I feel that I am now working upon C shell but when I do echo $SHELL it shows me the result /bin/bash, but it should be the output something like /bin/csh why does it still showing me the echo /bin/bash

Thanks
ADI

Try echo $0

This code may help.
env | awk '/SHELL/ {print $0}'

Thanks,
R. Singh

But my question is why not it shows the correct shell name when I write echo $SHELL

SHELL is set by login(1), not by the shell, so it doesn't change when you change shells.

1 Like

Hi,

Add this to .cshrc

cat .cshrc
setenv SHELL /bin/csh

I am not able to find the path where .cshrc file is located.

ADI

If you prefer to use the CShell then use the chsh command to change your default login shell:

chsh -s /bin/csh

If it exists, it will be in your home directory. If it doesn't exist, you can create it.

I'm not sure we want to be encouraging anyone to use C-Shell, do we? :slight_smile:

Some people prefer the rough stuff.... :slight_smile: