3

I need to switch to c-shell and after installing it via software-center it looks like I am ready to go.

Nevertheless, when I type 'csh' the line changes to %_ I am still not in a c-shell. When typing which $SHELL I get /bin/bash

Also my program is recognizing I am wrong and gives me error messages. I guess there is a simple solution?

thanks in advance

3 Answers3

5

The SHELL environment variable does not indicate what shell you are currently using. It is simply set, when you log in, to the value of the login shell field of /etc/passwd, which in your case is /bin/bash.

If you want to change your login shell, run chsh (change shell).

The login shell set in /etc/passwd controls, among other things, what shell is run when you open a terminal emulator, such as gnome-terminal.

To see what shell you are currently using, try ps -p $$

geirha
  • 46,101
  • thanks!

    Indeed, I am running csh after typing csh... clear.

    But, I don't know why I have a strange behavior within the shell? I do not have tab completion... And my software is complaining that this might not be a c-shell (and therefore I can't install). Are there some options that I can activate?

    thanks again!

    – Hydrazin Mar 08 '12 at 14:53
  • 1
    @Hydrazin The shell from the csh package does not have tab-completion. tcsh does though, so maybe you want that instead. However, if all you want is to run a csh script, you do not need to run csh as an interactive shell at all. From any shell, just run csh scriptfile. – geirha Mar 08 '12 at 15:25
0

You need to change your default login shell and there many ways to do this. The command to change shells is --> chsh -s csh <-- will change your login shell to csh. After this it will be nessesary to logout and login to your account. --> Ctl-d <-- is for logout.

Also, you can check out all of the users login shells in the /etc/passwd file. It is the last field in the record and should be /bin/bash now. Be very careful in this file however! Incorrect settings will prevent user login!

  • thanks for the respond!

    after writing chsh -s csh I get the answer: chsh: csh is an invalid shell

    thanks kind of strange?

    – Hydrazin Mar 08 '12 at 15:02
  • @Hydrazin The argument to chsh -s, the shell to be set, should be an absolute path, and must be listed in /etc/shells. cat /etc/shells – geirha Mar 08 '12 at 16:24
0

To see what shell you are currently using, try echo $0