Sridhar Sarnobat
Sridhar Sarnobat

Reputation: 23

Bash - bind key to a string (not a function)

How do I get a key binding to result in inserting arbitrary text at the command line? In zsh I do this:

bindkey -s "^[m" 'myspecialscript '

In bash, is there an equivalent? None of the built-in functions will do what I want.

Upvotes: 2

Views: 927

Answers (1)

nsfyn55
nsfyn55

Reputation: 15363

bind '"\e[[E": "/home/yourscript.sh\n"' binds to f5 replace the first part with your key pref

Upvotes: 2

Related Questions