Shekhar Kanodia Shekhar Kanodia - 1 year ago 63
Bash Question

Switching from bash to csh prompt

I work on linux console and need to work on csh prompt. However the default prompt is bash and I have to give the command csh to change the mode. The reason for switching the prompt is that there are some background files which run only in csh prompt.


-bash-4.1$ ade useview shkanodi_sqlplus_v1

bash: /usr/local/nde/setup/nderc.csh: line 44: syntax error near unexpected toke n `('
bash: /usr/local/nde/setup/nderc.csh: line 44: `foreach file (.ndeprodrc .ndevie wrc)'
bash: /etc/skel/cshrc-DEFAULT: line 20: syntax error: unexpected end of file

In the above example the command
ade useview shkanodi_sqlplus_v1
is not executed properly in bash prompt and I first have to give csh command and then run the command. I would like to bypass giving csh command.


1.Make sure you've got csh installed.

2.Learn the location of csh:

which csh
whereis csh

Below, I'll assume the location is /bin/bash.

a) If you have administrative rights, just run as root:

usermod -s /bin/csh YOUR_USERNAME

(replacing YOUR_USERNAME with your user name).

b) If you don't have adm. rights, you can still just run csh --login at login, by putting the below line at the end of your .profile (in your home directory) :

setenv SHELL /bin/bash
exec /bin/csh --login

Refrence : bash from csh