【问题标题】:Why does running "echo $-" output "himBH" on the bash shell?为什么在 bash shell 上运行“echo $-”会输出“himBH”?
【发布时间】:2016-02-16 12:25:02
【问题描述】:

我正在使用 macOS。当我打开一个 bash shell 并执行echo $- 时,它会输出himBH。这是什么意思?

【问题讨论】:

标签: bash macos shell


【解决方案1】:

它显示您的内置设置标志。 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.

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-11-06
    • 2021-09-08
    • 1970-01-01
    • 2011-01-01
    • 2012-09-03
    • 2021-05-22
    • 2015-11-06
    • 1970-01-01
    相关资源
    最近更新 更多