home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / unix / question / 13385 < prev    next >
Encoding:
Internet Message Format  |  1992-11-14  |  1.5 KB

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