Section 5.2. Selecting a Shell


[Page 169 (continued)]

5.2. Selecting a Shell

When you first get an account on a Linux machine, the account will use Bourne Again Shell (/bin/bash) as its login shell. But using bash is not a requirement, you can choose any shell to be your login shell.

To change your default login shell, use the chsh utility (Figure 5-2).

Figure 5-2. Description of the chsh command.

Utility: chsh

chsh allows you to change your default login shell. It prompts you for the full pathname of the new shell, which is then used as your shell for subsequent logins.


In order to use chsh, you must know the full pathnames of the shells (Figure 5-3).

Figure 5-3. Common shell locations.

Shell

Full pathname

Bash

/bin/bash (or /bin/sh)

Korn

/bin/ksh

C

/bin/tcsh (or /bin/csh)


In the following example, I changed my default login shell from Bash to a C shell:

$ chsh                 ...change the login shell. Changing shell for glass Password:              ...must verify you are who you say. New shell [/bin/bash]: /bin/tcsh    ...enter full pathname. $ ^D                   ...terminate login shell. login: glass           ...log back in again. Password:              ...secret. % _                    ...this time I'm in a C shell. 



[Page 170]

Another way to find out the full pathname of your login shell is to type the following:

$ echo $SHELL   ...display the name of my login shell. /bin/tcsh       ...full pathname of the C shell. $ _ 


This example illustrated the echo shell command and a shell variable called SHELL. Both of these new facilitiesechoing and variablesare discussed later in this chapter.




Linux for Programmers and Users
Linux for Programmers and Users
ISBN: 0131857487
EAN: 2147483647
Year: 2007
Pages: 339

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net