您尚未登录。

#1 2014-02-07 21:28:37

iprocoder
会员
注册时间: 2014-01-28
帖子: 4

$- 变量的含义

我想问一下在shell中 $- 变量的含义,有没有什么 man page。

PS:默认值
user $ echo $-
himBH

离线

#2 2014-02-07 23:17:30

cjxgm
忙,却还想养猫?
所在地: 杭州
注册时间: 2011-08-19
帖子: 417
个人网站

Re: $- 变量的含义

man bash
/\$-                  # 可以看到 i 表示 interactive
n                     # 可以看到:The current set of options may be found in $-.
往上翻,可以看到
              -h      Remember  the location of commands as they are looked up
                      for execution.  This is enabled by default.
              -m      Monitor mode.  Job control is enabled.  This  option  is
                      on  by  default  for  interactive shells on systems that
                      support it (see JOB  CONTROL  above).   Background  pro‐
                      cesses  run  in a separate process group and a line con‐
                      taining their exit status is printed upon their  comple‐
                      tion.
              -B      The shell performs brace expansion (see Brace  Expansion
                      above).  This is on by default.
              -H      Enable !  style history substitution.  This option is on
                      by default when the shell is interactive.

最近编辑记录 cjxgm (2014-02-07 23:18:50)

离线

页脚