set命令詳解
set命令用於設置shell內部的命令選項,它可以打開或者關閉相應的選項。
例如:
set -e # 打開errexit內置命令
除了這種方式,可以使用set -o 選項打開或者關閉相應的選項。
set -o option # 打開option set +o option # 關閉option
使用set -o可以查看所有的內置命令。
$ set -o set -o allexport off braceexpand on emacs off errexit off errtrace off functrace off hashall on histexpand on history on ignoreeof off interactive-comments on keyword off monitor on noclobber off noexec off noglob off nolog off notify off nounset off onecmd off physical off pipefail off posix off privileged off verbose off vi off xtrace off