【发布时间】:2016-02-16 12:25:02
【问题描述】:
我正在使用 macOS。当我打开一个 bash shell 并执行echo $- 时,它会输出himBH。这是什么意思?
【问题讨论】:
-
你试过阅读the BASH manual page吗?更具体地说,请查看“特殊参数”部分。
我正在使用 macOS。当我打开一个 bash shell 并执行echo $- 时,它会输出himBH。这是什么意思?
【问题讨论】:
它显示您的内置设置标志。 man bash 然后查找 SHELL BUILTIN COMMANDS,然后查找 set subsection。你会发现所有这些标志的含义:
h: Remember the location of commands as they are looked up for execution. This is enabled by default.
i: interactive
m: Monitor mode. Job control is enabled
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.
【讨论】: