home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / unix / aix / 13739 < prev    next >
Encoding:
Text File  |  1993-01-27  |  2.8 KB  |  75 lines

  1. Newsgroups: comp.unix.aix
  2. Path: sparky!uunet!ukma!gatech!udel!louie!eplrx7!cheung
  3. From: cheung@eplrx7.es.duPont.com (Bryan Cheung)
  4. Subject: Re: AIX Function Equivalent To VM's "RETRIEVE" Function
  5. Message-ID: <1993Jan26.153152.2256@eplrx7.es.duPont.com>
  6. Followup-To: comp.unix.aix
  7. Sender: Bryan Cheung
  8. Organization: DuPont
  9. References: <93025.145117SYST8103@RyeVm.Ryerson.Ca>
  10. Distribution: na
  11. Date: Tue, 26 Jan 1993 15:31:52 GMT
  12. Lines: 61
  13.  
  14. > On a VM system we can set up a PFkey to recall any commands just
  15. > entered *AND* modify them.  AIX's 'history function' only lets me
  16. >re-issue commands just entered *unmodified*.
  17.  
  18. This problem is not specific to AIX, but to the command language 
  19. interpreter (shell) you are using. AIX defaults to the Korn shell
  20. (/bin/ksh).
  21.  
  22. > For example I type in (because I am a programmer, not a typist :-)):
  23. >     "gp /usr/lpp/info/En_US/sys.sys"
  24. > when I should have typed:
  25. >     "pg /usr/lpp/info/En_US/sys.sys"
  26.  
  27. If you are using the Korn shell, you can do this with the following:
  28.  
  29.    <ctrl-P>    # retrieves your previous typo'd command(s)
  30.    <ctrl-A>    # moves to the beginning of the bad command line
  31.    <ctrl-T>    # "twiddles" the current and next characters from gp to pg
  32.  
  33.    This assumes you are using the emacs command line editting mode, which
  34.    can be enabled with:
  35.         $ set -o emacs
  36.  
  37. If you are using the C shell (/bin/csh) you can do the following:
  38.  
  39. % ^gp^pg          # replaces gp with pg in the previous command.
  40.  
  41. A few other notes:
  42.  
  43. The Korn shell command line editting keys can be switched to vi
  44. or emacs using the set -o emacs/vi command or by setting your  EDITOR
  45. variable to vi/emacs. Of the two, emacs has a *slightly* more
  46. mnemonic set of keybindings than vi. My personal preference is 
  47. emacs which is (which infinitely more cool than vi ;-). A few useful 
  48. emacs keybindings are listed below.
  49.  
  50.       <ctrl-N>  Next command line
  51.       <ctrl-P>  Previous command line
  52.       <ctrl-F>  Forward 1 character
  53.       ESC F     Forward 1 word
  54.       <ctrl-B>  Backward 1 character
  55.       ESC B     Backward 1 word
  56.  
  57.       <ctrl-D>  Delete current character
  58.       <ctrl-K>  Cut to end of line (Kill text)
  59.       <ctrl-Y>  Paste last cut (Yank)
  60.      
  61.       <ctrl-R>xxx  Reverse search for last command containing xxx
  62.  
  63.       The man pages on the ksh (man ksh) have a complete listing of
  64.       the _MANY_ vi/emacs/gmacs commands you can use to edit command 
  65.       lines. This is also in info, but you have to dig for it.
  66.  
  67. The C Shell has a *very* complex and powerful set of command line
  68. editting features. The syntax is horribly ugly, not mnemonic, and
  69. very difficult for new users to adjust to. If you are interested
  70. (or just masochistic) read the man pages.
  71.  
  72.                     Hope this helps,
  73.                         -- Bryan Cheung
  74.                            cheung@eplrx7.es.dupont.com
  75.