$- 在 Bash 中是什么意思?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/42757236/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What does $- mean in Bash?
提问by Izy-
I was playing around on the shell when by mistake, I typed echo $-
and I got the result himBH
. Immediately, I tried all other combinations of symbols along with the $ sign but with no luck.
I read thispost but I didn't fully understand it. Can someone please epxlain what they mean by 'shell options' and what himBH is supposed to mean?
我在 shell 上玩的时候不小心打错了,我输入echo $-
了结果himBH
。我立即尝试了所有其他符号组合以及 $ 符号,但没有成功。我读了这篇文章,但我没有完全理解它。有人可以解释一下'shell选项'的含义以及himBH的含义吗?
Much thanks!
非常感谢!
回答by anubhava
$-
prints The current set of options in your current shell.
$-
打印当前 shell 中的当前选项集。
himBH
means following options are enabled:
himBH
表示启用以下选项:
H
-histexpand
m
-monitor
h
-hashall
B
-braceexpand
i
-interactive
H
——histexpand
m
——monitor
h
——hashall
B
——braceexpand
i
——interactive