]> git.ipfire.org Git - thirdparty/bash.git/blob - RBASH
Bash-5.2 patch 26: fix typo when specifying readline's custom color prefix
[thirdparty/bash.git] / RBASH
1 6.10 The Restricted Shell
2 =========================
3
4 If Bash is started with the name 'rbash', or the '--restricted' or '-r'
5 option is supplied at invocation, the shell becomes restricted. A
6 restricted shell is used to set up an environment more controlled than
7 the standard shell. A restricted shell behaves identically to 'bash'
8 with the exception that the following are disallowed or not performed:
9
10 * Changing directories with the 'cd' builtin.
11 * Setting or unsetting the values of the 'SHELL', 'PATH', 'ENV', or
12 'BASH_ENV' variables.
13 * Specifying command names containing slashes.
14 * Specifying a filename containing a slash as an argument to the '.'
15 builtin command.
16 * Specifying a filename containing a slash as an argument to the '-p'
17 option to the 'hash' builtin command.
18 * Importing function definitions from the shell environment at
19 startup.
20 * Parsing the value of 'SHELLOPTS' from the shell environment at
21 startup.
22 * Redirecting output using the '>', '>|', '<>', '>&', '&>', and '>>'
23 redirection operators.
24 * Using the 'exec' builtin to replace the shell with another command.
25 * Adding or deleting builtin commands with the '-f' and '-d' options
26 to the 'enable' builtin.
27 * Using the 'enable' builtin command to enable disabled shell
28 builtins.
29 * Specifying the '-p' option to the 'command' builtin.
30 * Turning off restricted mode with 'set +r' or 'set +o restricted'.
31
32 These restrictions are enforced after any startup files are read.
33
34 When a command that is found to be a shell script is executed (*note
35 Shell Scripts::), 'rbash' turns off any restrictions in the shell
36 spawned to execute the script.
37