Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
変数 cmd がある場合、キーをその変数の内容にバインドしたい
例えば:
bind '"\C-h":"$cmd"'
しかし、うまくいきません。どのようにできるのか?
どうぞ:
bind -x '"\C-h":READLINE_LINE="$READLINE_LINE""$cmd"; ((READLINE_POINT += ${#cmd}));'
4.2でテストされ、魅力のように機能します。ただし、3.x では動作しません。お楽しみください!