在bash 参考手册中,它指出:
lithist
如果启用并启用该cmdhist
选项,多行命令将使用嵌入的换行符保存到历史记录中,而不是在可能的情况下使用分号分隔符。
因此我的问题是:这在哪里/何时/如何可能?
我尝试在我的GNU bash 版本 4.4.12(1)-release上启用和测试该功能,这样做:
shopts -s cmdhist
shopts -s lithist
echo -n "this is a test for a ";\
echo "multiline command"
Run Code Online (Sandbox Code Playgroud)
然后我做了一个
history | tail
Run Code Online (Sandbox Code Playgroud)
期待一些类似于此的输出:
101 shopts -s cmdlist
102 shopts -s lithist
103 echo -n "this is a test for a ";\
echo "multiline command"
104 history
Run Code Online (Sandbox Code Playgroud)
而是得到这个:
101 shopts -s cmdlist
102 shopts -s lithist
103 echo -n "this is a …
Run Code Online (Sandbox Code Playgroud)