home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.aix
- Path: sparky!uunet!ukma!gatech!udel!louie!eplrx7!cheung
- From: cheung@eplrx7.es.duPont.com (Bryan Cheung)
- Subject: Re: AIX Function Equivalent To VM's "RETRIEVE" Function
- Message-ID: <1993Jan26.153152.2256@eplrx7.es.duPont.com>
- Followup-To: comp.unix.aix
- Sender: Bryan Cheung
- Organization: DuPont
- References: <93025.145117SYST8103@RyeVm.Ryerson.Ca>
- Distribution: na
- Date: Tue, 26 Jan 1993 15:31:52 GMT
- Lines: 61
-
- > On a VM system we can set up a PFkey to recall any commands just
- > entered *AND* modify them. AIX's 'history function' only lets me
- >re-issue commands just entered *unmodified*.
-
- This problem is not specific to AIX, but to the command language
- interpreter (shell) you are using. AIX defaults to the Korn shell
- (/bin/ksh).
-
- > For example I type in (because I am a programmer, not a typist :-)):
- > "gp /usr/lpp/info/En_US/sys.sys"
- > when I should have typed:
- > "pg /usr/lpp/info/En_US/sys.sys"
-
- If you are using the Korn shell, you can do this with the following:
-
- <ctrl-P> # retrieves your previous typo'd command(s)
- <ctrl-A> # moves to the beginning of the bad command line
- <ctrl-T> # "twiddles" the current and next characters from gp to pg
-
- This assumes you are using the emacs command line editting mode, which
- can be enabled with:
- $ set -o emacs
-
- If you are using the C shell (/bin/csh) you can do the following:
-
- % ^gp^pg # replaces gp with pg in the previous command.
-
- A few other notes:
-
- The Korn shell command line editting keys can be switched to vi
- or emacs using the set -o emacs/vi command or by setting your EDITOR
- variable to vi/emacs. Of the two, emacs has a *slightly* more
- mnemonic set of keybindings than vi. My personal preference is
- emacs which is (which infinitely more cool than vi ;-). A few useful
- emacs keybindings are listed below.
-
- <ctrl-N> Next command line
- <ctrl-P> Previous command line
- <ctrl-F> Forward 1 character
- ESC F Forward 1 word
- <ctrl-B> Backward 1 character
- ESC B Backward 1 word
-
- <ctrl-D> Delete current character
- <ctrl-K> Cut to end of line (Kill text)
- <ctrl-Y> Paste last cut (Yank)
-
- <ctrl-R>xxx Reverse search for last command containing xxx
-
- The man pages on the ksh (man ksh) have a complete listing of
- the _MANY_ vi/emacs/gmacs commands you can use to edit command
- lines. This is also in info, but you have to dig for it.
-
- The C Shell has a *very* complex and powerful set of command line
- editting features. The syntax is horribly ugly, not mnemonic, and
- very difficult for new users to adjust to. If you are interested
- (or just masochistic) read the man pages.
-
- Hope this helps,
- -- Bryan Cheung
- cheung@eplrx7.es.dupont.com
-