home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.unix.questions:13385 comp.unix.wizards:4677
- Path: sparky!uunet!ukma!usenet.ins.cwru.edu!odin!chet
- From: chet@odin.ins.cwru.edu (Chet Ramey)
- Newsgroups: comp.unix.questions,comp.unix.wizards
- Subject: Re: REMAPPING KEYS WITHIN BASH/SH
- Date: 13 Nov 1992 22:22:40 GMT
- Organization: Case Western Reserve University, Cleveland OH (USA)
- Lines: 24
- Message-ID: <1e19rgINNr57@usenet.INS.CWRU.Edu>
- References: <BxM2EA.Hyt@cs.dal.ca>
- NNTP-Posting-Host: odin.ins.cwru.edu
-
- In article <BxM2EA.Hyt@cs.dal.ca> franklin@thans.cs.dal.ca (Steve Franklin) writes:
- >It would be wholly to my benefit to be able to remap keys within the
- >bash or sh shell, but I'm not quite sure to go about doing this.
-
- Bash supports this. The readline library, which is used by bash and
- certain other Gnu utilities (e.g., gdb), has its own startup file
- (~/.inputrc), and a syntax for rebinding keys within it. Bash also
- provides the `bind' builtin to allow keybindings to be changed on
- the fly from a shell prompt.
-
- >Can I map Character sequences to the execution of scripts? I don't see
- >why not, but I'm not quite sure how I would go about doing this...
-
- Bash allows you to bind keys to `macros', which cause character strings
- to be inserted into the text. You can bind a key sequence to the
- equivalent of, for instance, "ls^M" and have that key execute `ls' when
- typed on an empty line.
-
- Chet
- --
- ``The use of history as therapy means the corruption of history as history.''
- -- Arthur Schlesinger
-
- Chet Ramey, Case Western Reserve University Internet: chet@po.CWRU.Edu
-