Chapter 6: Bash Features

81

--restricted

Make the shell a restricted shell (see Section 6.10 [The Restricted Shell], page 93).

--verbose

Equivalent to -v. Print shell input lines as they’re read.

--version

Show version information for this instance of Bash on the standard output and exit successfully.

There are several single-character options that may be supplied at invocation which are not available with the set builtin.

-c

Read and execute commands from the first non-option argument after pro- cessing the options, then exit. Any remaining arguments are assigned to the positional parameters, starting with $0.

-i

Force the shell to run interactively. Interactive shells are described in Section 6.3

[Interactive Shells], page 83.

-l

Make this shell act as if it had been directly invoked by login. When the shell is interactive, this is equivalent to starting a login shell with ‘exec -l bash’.

When the shell is not interactive, the login shell startup files will be executed.

‘exec bash -l’ or ‘exec bash --login’ will replace the current shell with a

Bash login shell. See Section 6.2 [Bash Startup Files], page 82, for a description of the special behavior of a login shell.

-r

Make the shell a restricted shell (see Section 6.10 [The Restricted Shell], page 93).

-s

If this option is present, or if no arguments remain after option processing, then commands are read from the standard input. This option allows the positional parameters to be set when invoking an interactive shell.

-D

A list of all double-quoted strings preceded by ‘$’ is printed on the standard output. These are the strings that are subject to language translation when the current locale is not C or POSIX (see Section 3.1.2.5 [Locale Translation], page 7). This implies the -n option; no commands will be executed.

[-+]O [shopt_option] shopt option is one of the shell options accepted by the shopt builtin (see

Section 4.3.2 [The Shopt Builtin], page 62). If shopt option is present, -O sets the value of that option; +O unsets it. If shopt option is not supplied, the names and values of the shell options accepted by shopt are printed on the standard output. If the invocation option is +O, the output is displayed in a format that may be reused as input.

--

A -- signals the end of options and disables further option processing. Any arguments after the -- are treated as filenames and arguments.

A login shell is one whose first character of argument zero is ‘-’, or one invoked with the

--login option.