I am currently in bash but I want to change my shell to tcsh. I used ypchsh, entered my password when prompted and then changed the login shell to /bin/tcsh. And it seemed like it worked because I get a message that says "The login shell has been changed on [domain]". Then I logged out and logged back in. I did echo $0 to check my current shell but it says I'm still in /bin/bash. However, when I do echo $SHELL I get /bin/tcsh. And when I do ps, it shows that bash is running instead of tcsh.
Other trouble shooting steps taken: Tried doing the same steps to switch to different shells like sh and ksh which works. However, changing to csh gives me the same result as trying to change to tcsh. Checked /etc/shells and tcsh is listed. I also tried exec tcsh but the system still running bash.
I am trying to do this on a school account so maybe there is a permission issue. Although one of my classmate was able to get his account to change shell. If not permission is there like file that I need to config?
[user@machine ~]> echo $0
/bin/bash
[user@machine ~]> echo $SHELL
/bin/tcsh
[user@machine ~]> ypchsh
Changing NIS account information for user on machine
Please enter password:
Changing login shell for user on machine
To accept the default, simply press return. To use the
system's default shell, type the word "none".
Login shell [/bin/tcsh]: /bin/tcsh
The login shell has been changed on machine
[user@machine ~]> logout
[user@machine ~]> echo $0
/bin/bash
[user@machine ~]> echo $SHELL
/bin/tcsh
[user@machine ~]> FOO=BAR
[user@machine ~]> ps
PID TTY TIME CMD
14549 pts/21 00:00:00 bash
14780 pts/21 00:00:00 ps
[user@machine ~]> exec /bin/tcsh
[user@machine ~]> echo $0
/bin/bash
[user@machine ~]> echo $SHELL
/bin/tcsh
[user@machine ~]> FOO=BAR
[user@machine ~]>
[user@machine ~]> uname -a
Linux machine 2.6.32-696.3.2.el6.i686 #1 SMP Tue Jun 20 00:48:23 UTC 2017 i686 i686 i386 GNU/Linux
[user@machine ~]> /bin/ls -ld
drwx--s--x 49 user group 4096 Sep 1 13:08 .
[user@machine ~]> /bin/*sh
/bin/csh: /bin/csh: cannot execute binary file
[user@machine ~]> /usr/bin/*sh
Usage: amuFormat.sh <Card Type> <drive>
<Card Type> has to be defined in amuFormat.sh itself
<drive> has to be defined in mtools.conf
FOO=BAR
? What shell are you really running? And seriously? You triedexec tcsh
and you’re still in bash? I feel like you’re not telling us the whole story.>
characters and insert$
before the shell commands. It’s best if you copy from your terminal and paste into Super User. (Of course it’s OK to redact sensitive information like your username and machine name.) But if your shell prompt changes, show that. (1) You say you’re not very familiar with the Linux systems. I have to wonder how much you understand about the *nix shells, and why you want to change yours. (2) When I say typeFOO=BAR
, I mean typeFOO=BAR
(followed by Enter) at the shell prompt.