3

I am facing a problem related to the shell change, when I change the shell from bash to csh and type the comand echo $SHELL, I expect the shell to print:

/bin/csh

But instead it prints:

/bin/bash

What is the reason for that? How do I print the path to the currently running shell instead?

6
  • What do you mean by "change shell"?
    – choroba
    Apr 17, 2016 at 18:42
  • It is still showing the shell which is in your environment variable...you need to do make the change in the .profile or .bashrc* and then '. .profile' or '. .bashrc*' and then try echoing that change.
    – Ashu
    Apr 17, 2016 at 18:43
  • 2
    echo $SHELL returns your default shell.
    – Mahdi
    Apr 17, 2016 at 18:45
  • @choroba i mean using csh shell instead of bash or any shell , change scripting language
    – eng_ahmed
    Apr 17, 2016 at 18:54
  • @Ashu , What i know that $SHELL Contains the type of the shell and updated when the shell changes
    – eng_ahmed
    Apr 17, 2016 at 18:56

1 Answer 1

1

To view your current shell use:

echo $0

$SHELL prints the default shell.

Not the answer you're looking for? Browse other questions tagged .