I would like to pass whatever the user has typed in a bash shell to a command, when the user presses a keyboard binding|shortcut
For example : Lets say Ctrl+b is our binding
bind '"\C-b": "myCommand.sh"'
tar czv then presses the shortcut—which passes the string 'tar czv' to mycommand.sh
Is this possible at all ? The only way I can think of is to pass it after echoing it.
bind '"\C-b": " \e[1~ echo '\''\e[4~'\''| mycommand.sh\n"'
Is there a better way?