I was just reading the readline man-page and discovered a bunch of great commands I didn't know about. However, several don't have default key bindings. Is there a way to execute the unbound commands from the shell?
I'm not asking how to bind the command in ~/.inputrc, but instead how to execute it as a "one off" from the shell or in a bash script.
For example, the "dump-variables" command. Is there some command I can feed "dump-variables" to as an argument to have it executed?
Best Answer
I believe what you are looking for is the
bind
command itself. According toman builtin
information runningbind <readline-command>
allows you to run one-offs, however, I couldn't get it to work like the manual says it should...it kept making keys not work for me; your mileage may vary. I did find the following commands which may be of use to you.Edit Note I would like to point out how annoying it is that it doesn't work like the manual says it should because if you type in
bind
and then press tab for auto-complete, it shows all of the commands.