Home > Software design >  Do the correct inputrc command by a shell line code
Do the correct inputrc command by a shell line code

Time:09-04

How do we do inputrc command by a shell line code as gave failure here

$ bind -x '"\C-l":next-history'

bash: next-history: command not found  
$ 

Please do sincere help

CodePudding user response:

According to man bash:

  • -x keyseq:shell-command

    Cause shell-command to be executed whenever keyseq is entered. [...]

So for your case when you press CTRL-L, Bash will try to execute a command named next-history.

To map to Readline's next-history you can write like this:

bind '"\C-l": next-history'
  • Related