Chapter 4: Shell Builtin Commands

61

posix

Change the behavior of Bash where the default opera- tion differs from the posix standard to match the stan- dard (see Section 6.11 [Bash POSIX Mode], page 94).

This is intended to make Bash behave as a strict su- perset of that standard. privileged

Same as -p. verbose

Same as -v. vi

Use a vi-style line editing interface. This also affects the editing interface used for read -e. xtrace

Same as -x.

-p

Turn on privileged mode. In this mode, the $BASH_ENV and $ENV files are not processed, shell functions are not inherited from the en- vironment, and the SHELLOPTS, BASHOPTS, CDPATH and GLOBIGNORE variables, if they appear in the environment, are ignored. If the shell is started with the effective user (group) id not equal to the real user (group) id, and the -p option is not supplied, these actions are taken and the effective user id is set to the real user id. If the

-p option is supplied at startup, the effective user id is not reset.

Turning this option off causes the effective user and group ids to be set to the real user and group ids.

-t

Exit after reading and executing one command.

-u

Treat unset variables and parameters other than the special param- eters ‘@’ or ‘*’ as an error when performing parameter expansion.

An error message will be written to the standard error, and a non- interactive shell will exit.

-v

Print shell input lines as they are read.

-x

Print a trace of simple commands, for commands, case commands, select commands, and arithmetic for commands and their argu- ments or associated word lists after they are expanded and before they are executed. The value of the PS4 variable is expanded and the resultant value is printed before the command and its expanded arguments.

-B

The shell will perform brace expansion (see Section 3.5.1 [Brace

Expansion], page 21). This option is on by default.

-C

Prevent output redirection using ‘>’, ‘>&’, and ‘<>’ from overwriting existing files.

-E

If set, any trap on ERR is inherited by shell functions, command substitutions, and commands executed in a subshell environment.

The ERR trap is normally not inherited in such cases.