[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This builtin is so complicated that it deserves its own section.
set
set [--abefhkmnptuvxBCHP] [-o option] [argument ...] |
If no options or arguments are supplied, set
displays the names
and values of all shell variables and functions, sorted according to the
current locale, in a format that may be reused as input.
When options are supplied, they set or unset shell attributes. Options, if specified, have the following meanings:
-a
-b
-e
until
or while
loop, part of an if
statement,
part of a &&
or ||
list, or if the command's return
status is being inverted using !
.
A trap on ERR
, if set, is executed before the shell exits.
-f
-h
-k
-m
-n
-o option-name
Set the option corresponding to option-name:
allexport
-a
.
braceexpand
-B
.
emacs
emacs
-style line editing interface (see section 8. Command Line Editing).
errexit
-e
.
hashall
-h
.
histexpand
-H
.
history
ignoreeof
keyword
-k
.
monitor
-m
.
noclobber
-C
.
noexec
-n
.
noglob
-f
.
nolog
notify
-b
.
nounset
-u
.
onecmd
-t
.
physical
-P
.
posix
privileged
-p
.
verbose
-v
.
vi
vi
-style line editing interface.
xtrace
-x
.
-p
$BASH_ENV
and $ENV
files are not
processed, shell functions are not inherited from the environment,
and the SHELLOPTS
variable, if it appears in the environment,
is 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
-u
-v
-x
-B
-C
-H
-P
cd
which change the current directory. The physical directory
is used instead. By default, Bash follows
the logical chain of directories when performing commands
which change the current directory.
For example, if `/usr/sys' is a symbolic link to `/usr/local/sys' then:
$ cd /usr/sys; echo $PWD /usr/sys $ cd ..; pwd /usr |
If set -P
is on, then:
$ cd /usr/sys; echo $PWD /usr/local/sys $ cd ..; pwd /usr/local |
--
-
Using `+' rather than `-' causes these options to be
turned off. The options can also be used upon invocation of the
shell. The current set of options may be found in $-
.
The remaining N arguments are positional parameters and are
assigned, in order, to $1
, $2
, ... $N
.
The special parameter #
is set to N.
The return status is always zero unless an invalid option is supplied.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |