set Flashcards
set
Set or unset values of shell options and positional parameters.
set
- a
- b
- e
- f
- h
- a, Mark variables which are modified or created for export.
- b, Notify of job termination immediatedly.
- e, Exit immediately if a command exits with a non-zero status.
- f, Disable file name generation (globbing).
- h, Remember the location of commands as they are looked up.
set
- k
- m
- n
- o
- k, All assignment arguments are placed in the environment for a command, not just those that precede the command name.
- m, Job control is enabled.
- n, Read commands but do not execute them.
- o, Option-name. Set a variable corresponding to an option-name.
set -o option-name
allexport or -a
braceexpand or -B
emacs, use an emacs-style line editing interface
errexit or -e
errtrace or -E
functrace or -T
set -o option-name
hashall or -h
histexpand or -H
history, Enable command history
ignoreeof, The shell will not exit upon reading EOF
interactive-comments, allow comments to appear in interactive commands
keyword -k
set -o option-name
monitor or -m
noclobber or -C
noexec or -n
noglob or -f
nolog, Currently accepted but ignored
notify or -b
set -o option-name
nounset or -u
onecmd or -t
physical or -P
pipefail, The return value of a pipeline is the status of the last command to exit with a non-zero status.
posix, Change the behavior of bash where the default operation differs from the Posix standard to match the standard.
set -o option-name
privilledged or -p
verbose or -v
set -o option-name
vi, use a vi-style line editing interface
xtrace or -x
set
- p
- t
- u
- p, Turned on whenever the real and effective user ids do not match. Disables processing of the $ENV file and importing of shell functions. Turning this option off causes the effective uid and gid to be set to the real uid and gid.
- t, Exit after reading and executing one command.
- u, Treat unset variables as an error when substituting.
set
- v
- x
- B
- C
- v, Print shell input lines as they read.
- x, Print commands and their arguments as they are executed.
- B, The shell will perform brace expansion.
- C, If set, disallow existing regular files to be overwritten by redirection of output.
set
- E
- H
- P
- T
- E, If set, the ERR trap is inherited by shell functions.
- H, Enable ! style history substitution. This flag is on by default when the shell is interactive.
- P, If set, do not resolve symbolic links when executing commands such as cd which change the current directory.
- T, If set, the DEBUG and RETURN traps are inherited by shell functions.