[Chapter 4] 4.9 Restricted Shells
Author: Daniel Gilly & the Staff of O'Reilly & Associates
Date: 1998-08-06T21:59:06Z

#

| Chapter 4 The Bourne Shell and Korn Shell |

## 4.9 Restricted Shells

Restricted shells can be invoked in any of the following ways:

>     rksh	Korn shell
>     ksh -r
>     set -r

>     rsh	Bourne Shell
>     set -r

Restricted shells can also be set up by supplying rksh and rsh in the shell field of /etc/passwd or by using them as the value for the SHELL variable.

Restricted shells act the same as their non-restricted counterparts, except that the following are prohibited:

- Changing directory (i.e., using cd).

- Setting the PATH variable. rksh also prohibits setting ENV and SHELL.

- Specifying a `/` for command names or pathnames.

- Redirecting output (i.e., using `>` and `>>`).

Shell scripts can still be run, since in that case the restricted shell will call ksh or sh to run the script.

4.8 Invoking the Shell |  | 5. The C Shell