我不理解bind -P
命令的输出。
字符是什么意思 -
"\C-g", "\C-x\C-g", "\e\C-g
"\e-", "\e0", "\e1", "\e2", "\e3", ...
请解释一下。
谢谢!
答案 0 :(得分:3)
"\C-g"
- Ctrl - g - 中止"\C-x\C-g"
- Ctrl - x - Ctrl - g - 中止"\e\C-g
- Esc - Ctrl - g - 中止"\e-"
- Esc - - - 开始计数参数的负数"\e0"
- Esc - 0 - 计数参数的数字"\e1"
- Esc - 1 - 相同"\e2"
- Esc - 2 - 相同"\e3"
- Esc - 3 - 相同有关详细信息,请参阅man readline
答案 1 :(得分:2)
根据bash的man page,-P
开关执行此操作:
List current Readline function names and bindings.
Readline也是library integrated with bash(通常)。因此,-P
开关中的绑定是运行关联的readline函数所必需的键盘组合。所以,例如:
... snip ...
beginning-of-line can be found on "\eOH", "\e[H".
call-last-kbd-macro is not bound to any keys
capitalize-word is not bound to any keys
character-search is not bound to any keys
character-search-backward is not bound to any keys
clear-screen is not bound to any keys
complete can be found on "\C-i".
... snip ...
这表明函数complete
绑定到组合"\C-i"
,它是control-i的简写。 \C
等字符是显示为控制代码的元键。