如何列出 readline 变量及其当前值

Arc*_*ton 2 command-line bash autocomplete readline

例如,我希望能够查看是否show-all-if-unmodified在当前会话中启用。

fra*_*san 6

您似乎正在寻找bind -V

$ bind -V | grep show-all-if-unmodified
show-all-if-unmodified is set to `off'
Run Code Online (Sandbox Code Playgroud)

据我所知,没有变量名称包含不同变量的完整名称(例如,没有show-all变量在用作非锚定模式时也匹配show-all-if-unmodified),也没有正则表达式上下文中的任何特殊字符。bind -V | grep因此,定义为 shell 别名或函数应该是安全的。