{"id":232,"date":"2005-04-26T13:37:14","date_gmt":"2005-04-26T18:37:14","guid":{"rendered":"https:\/\/www.suramya.com\/blog\/2005\/04\/26\/find-and-bind-key-sequences-in-bash\/"},"modified":"2005-04-26T13:37:14","modified_gmt":"2005-04-26T18:37:14","slug":"find-and-bind-key-sequences-in-bash","status":"publish","type":"post","link":"https:\/\/www.suramya.com\/blog\/2005\/04\/find-and-bind-key-sequences-in-bash\/","title":{"rendered":"Find and bind key sequences in bash"},"content":{"rendered":"\n<p>This Tip was taken from a <a href='http:\/\/techrepublic.com.com\/5100-10591_11-5683375.html?tag=nl.e011'>TechRepublic article<\/a> by <a href='http:\/\/techrepublic.com.com\/5171-22-1031717.html'>Vincent Danen<\/a>. It will allow the user to map unused key combinations to run custom commands in the shell. <\/p>\n<p>To obtain the key sequence from a function key, use the read command. The following is an example of pressing the [F12] key:<\/p>\n<p>$ read<\/p>\n<p>^[[24~<\/p>\n<p>Note that different keyboards will produce different key sequences, and modifiers to the function keys (such as [Ctrl][F12] or [Shift][F12]) will produce other sequences as well.<\/p>\n<p>The next step is to bind that key sequence to a particular shell command. For example, you can bind [F12] to the &#8216;history-search-backward&#8217; shell command:<\/p>\n<p>$ bind &#8216;&#8217;\\e[24~&#8217;: history-search-backward&#8217;<\/p>\n<p>&#8211; Suramya<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This Tip was taken from a TechRepublic article by Vincent Danen. It will allow the user to map unused key combinations to run custom commands in the shell. To obtain the key sequence from a function key, use the read command. The following is an example of pressing the [F12] key: $ read ^[[24~ Note [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[14],"tags":[],"class_list":["post-232","post","type-post","status-publish","format-standard","hentry","category-tutorials"],"_links":{"self":[{"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/posts\/232","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/comments?post=232"}],"version-history":[{"count":0,"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/posts\/232\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/media?parent=232"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/categories?post=232"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/tags?post=232"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}