|
|
A shell is a command interpreter that forms the basic interactive interface to the UnixWare system. The shell's basic functions are to run executable files and to provide programming features such as variables, functions, I/O, and flow control.
The UnixWare shell is commonly called the Bourne shell. Two copies of this shell exist on the system. One copy resides in the file /usr/bin/sh and is intended for unprivileged interactive and interpretive use. Another version of the Bourne shell resides in the file /sbin/sh and is intended for the execution of trusted administrative shell scripts.
The shell runs with no privileges of its own and its ability to perform sensitive operations is limited by the privilege(s) of the invoking process.
Note that no shell has fixed privileges or performs sensitive operations. The tfadmin command spawns a child process to do the work of a command (such as mount) that the user is attempting to execute. In this regard, tfadmin acts as a command processor rather than a command interpreter.
The Bourne shell is documented in sh(1). Other shells (such as csh, ksh, and jsh) exist on the system.
So far as the kernel is concerned, a shell is just like any other process in user space. A shell does not enforce access policy or have any special privileges. Like any other user process, it runs with the privileges of the process that invokes it. That is, the system enforces access restrictions on the shell as it does on any process.
The shell maintains an environment made up of a set of variables and values for each. These variables may be conventional names used by the shell or other programs, system-defined variables, or user-defined variables. For example, two of the most important variables used by the shell are PATH, a list of directories that the shell searches for executable programs, and HOME, the name of the user's home directory. The env command lists the user's environment.
When it starts, the shell reads a system startup file, /etc/profile, which gives the user an initial environment supplied by the system administrator. Then it reads a personal startup file, $HOME/.profile, which users may tailor to their own preferences - see profile(4).
The typical operation of the shell after it sets up the user's environment is to enter an infinite loop, reading user input and executing it. The user may leave the shell by entering the shell exit command. If a user exits the top-level shell (the shell spawned when the user logged in), the login session is ended and the user must go through the login procedure again to get a new shell.