My administrator says that my default shell is set to
$ echo $SHELL /bin/csh $
Is the default shell related to the
SHELL variable at all? Is not, what is the variable used for?
That's not 100% true. For example:
$SHELL contains the parent shell for your session, which is commonly your login shell as dictated by your user entry in /etc/passwd. More clearly, $SHELL is the parent shell from which your current session spawned. In my example the current shell, Korn, is technically running within BASH, which is why $SHELL was unmodified.
Obviously this is an almost exclusively semantic distinction, however, do not fall into the trap of believing that what you see is always what you get.
No, it is not related to default shell.
The system default shell is defined in
Your default shell is defined in
The variable is for your information ("Hey, what shell am I running under?") rather than the way you set the shell. Since Unix environment variables can only propagate down to child processes and not back up to parents, generally environment variables like this are descriptive rather than configuration options.
To see your default shell, look at your entry in
The “default shell“ for a unix system administrator is what is stored in the “shell” column of the user database. This is the program that is invoked when you log in in text mode (on a text mode console, or over the network via e.g. ssh).
The ”default shell” for a unix application is either
That bit about the preferred command language means that some applications may try to run commands in
In practice, for a unix user,
For example, I typically leave whatever login shell is the default, maintain a Bourne-compatible
I always understood environmental variables to be advisory to programs you are running. $SHELL would be the shell you want a program to start when it needs to run a shell. Compare with $EDITOR, you email program might use it to decide which editor to offer you. B/c these environmental variables are so easy to change you can't really rely on them as the final word on what the world is really like.
Related to your question on default shell: chsh is a command that allows you to change your login shell. Before changing it shows you what your current choice is.