51.9 Making a "Login" ShellWhen you log in to most UNIX systems, your shell is a login shell . When a shell is a login shell, it acts differently. For example, the shell reads a special setup file ( 2.2 ) like .profile or .login . UNIX "knows" how to tell the shells to be login shells. If you type the shell's name (like sh or /bin/csh ) at a prompt, that will not start a login shell.
Sometimes, when you're testing an account or using a window system,
you want to start a login shell without logging in.
UNIX shells act like login shells when they are executed with a name that
starts with a dash (
It's better to make a symbolic link ( 18.4 ) to the shell:
$ (Or, if your own bin subdirectory is on the same filesystem as /bin , you can use a hard link ( 18.4 ) .) A third way is to write a little C program ( 52.8 ) that runs the actual shell but tells the shell that its name starts with a dash. This is how the UNIX login process does it:
main() { execl("/bin/csh", "-csh", 0); } No matter which way you choose, you can execute your new shell by typing its name:
$ Article 2.16 shows how this can be used to change your normal login shell. - |
|