1.

You Need To Define A Macro, A Key Binding For The Existing Command. How Would You Do It?

Answer»

There is a command called BIND, in bash shell which is CAPABLE of defining macro, or binding a KEY. In order to bind a key with an existing command, we need to generate Character Sequence emitted by the key. Press Ctrl+v and then key F12, I got ^ [[24~

[root@localhost ~]# bind '"e[24~":"date"'

DIFFERENT types of TERMINALS or terminal emulators can emit different codes for the same key.

There is a command called bind, in bash shell which is capable of defining macro, or binding a key. In order to bind a key with an existing command, we need to generate Character Sequence emitted by the key. Press Ctrl+v and then key F12, I got ^ [[24~

[root@localhost ~]# bind '"e[24~":"date"'

Different types of terminals or terminal emulators can emit different codes for the same key.



Discussion

No Comment Found