现在的位置: 首页 > 综合 > 正文

LINUX set 和 shopt

2018年05月16日 ⁄ 综合 ⁄ 共 843字 ⁄ 字号 评论关闭
set命令可以用来定制shell环境,使用选项“o”来打开或者关闭选项。例如打开选项:set -o 选项,关闭选项目:set +o 选项。

  例如要打开vi交互式命令行编辑,则如下:
[root@localhost ~]# set -o   #查看当前设置情况
allexport       off
braceexpand     on
emacs           on
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
[root@localhost ~]# set -o vi   #把vi选项打开
[root@localhost ~]# set -o      #查看当前设置情况
allexport       off
braceexpand     on
emacs           off
errexit         off
errtrace        off
functrace       off

抱歉!评论已关闭.