The set command can be used to set the shell execution method, which can be set according to different requirements.
Syntax
Set [+-abCdefhHklmnpPtuvx]
Parameter description:
- -A indicates the modified variables for output to the environment variables.
- -B: immediately returns the execution status of the terminated background program.
- -C: The generated file cannot overwrite the existing file.
- -D Shell uses the command used by the table to accelerate the execution of the command. The-d parameter can be canceled.
- -E. If the return value of the command is not equal to 0, exit the shell immediately.
- -F cancels the use of wildcards.
- -H automatically records the location of the function.
- -H Shell can use "! "Add <command number> to execute commands recorded in history.
- The parameters given by the-k command are considered as the environment variables of the command.
- -L record the variable name of the for loop.
- -M uses the monitoring mode.
- -N: only read commands, not actually executed.
- -P starts the priority mode.
- After the-P parameter is started, the symbolic connection is replaced by the actual file or directory when the command is executed.
- -T run the subsequent command to exit the shell.
- -U: an error message is displayed when undefined variables are used during execution.
- -V displays the input values read by shell.
- -X: after the command is executed, the command and its parameters are displayed first.
- + <Parameter> cancel a parameter that was started by a set.
Instance
Show environment variables
# Set
BASH =/bin/bash
BASH_ARGC = ()
BASH_ARGV = ()
BASH_LINENO = ()
BASH_SOURCE = ()
BASH_VERSINFO = ([0] = "3" [1] = "00" [2] = "15" [3] = "1" [4] = "release" [5] = "i386-redhat-linux-gnu ")
BASH_VERSION = '3. 00.15 (1)-release'
COLORS =/etc/DIR_COLORS.xterm
COLUMNS = 99
DIRSTACK = ()
EUID = 0
GROUPS = ()
G_BROKEN_FILENAMES = 1
HISTFILE =/root/. bash_history
HISTFILESIZE = 1000
History size = 1000
HOME =/root
HOSTNAME = hnlinux
HOSTTYPE = i386
IFS = $''
INPUTRC =/etc/inputrc
KDEDIR =/usr
LANG = zh_CN.GB2312
LESSOPEN = '|/usr/bin/lesspipe. sh % s'
LINES = 34
L
MAIL =/var/spool/mail/root
MAILCHECK = 60
OLDPWD =/home/uptech
OPTERR = 1
OPTIND = 1
OSTYPE = linux-gnu
PATH =/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin: /usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin: /opt/crosstools/gcc-3.4.6-glibc-2.3.6/bin PIPESTATUS = ([0] = "2 ")
PPID = 26005
PROMPT_COMMAND = 'echo-ne"