Latest web development tutorials

Linux set command

Linux command Daquan Linux command Daquan

Linux set command to set shell.

set instruction can be used to set the shell implementation, you can do to set according to different needs.

grammar

set [+-abCdefhHklmnpPtuvx]

Parameter Description:

  • -a marked modified variables for output to an environment variable.
  • -b make daemon aborted immediately return execution state.
  • -C Steering resulting file can not overwrite existing files.
  • -d Shell will use the default hash table memory used instructions to speed up execution of the instruction. Use the -d parameter to cancel.
  • -e command if the return value is not equal to 0, then immediately exit the shell.
  • -f eliminate the use of wildcards.
  • -h location of automatic recording function.
  • -H Shell can use the "!" Plus <command number> way to execute instructions recorded in history.
  • -k command to the arguments will be considered in this instruction environment variables.
  • -l variable names for loop recording.
  • -m to use the monitor.
  • -n read-only command, without actually executed.
  • -p Start Priority mode.
  • After -P -P startup parameters, when the instruction is executed, it will be the actual file or directory to replace symbolic links.
  • -t executing the subsequent instructions to exit shell.
  • -u use when performing off to an undefined variable error message is displayed.
  • -v Displays shell input values ​​read.
  • After -x execute instructions that parameters and under will be displayed.
  • + <Parameter> to cancel a parameter set has been started.

Examples

Display environment variable

# 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
HISTSIZE=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 "

Linux command Daquan Linux command Daquan