Command-Line Editing

By now you might be wondering how you can go back and re-execute commands you’ve typed earlier without retyping them. The Bourne shell does not allow command-line editing, but the Korn shell does. In this section, I’ll describe how to use command-line editing, but we need to set up a few variables in the Korn shell before we proceed.

Set your default editor to be the vi editor as follows:

VISUAL=vi <cr> 

If the VISUAL variable is not set, the shell will look at the EDITOR variable. You can set the EDITOR variable as follows:

EDITOR=vi; export EDITOR <cr> 

Now you have vi editor commands available to you as you type commands. See Chapter 2, “Using Solaris Editors,” for a complete discussion on the vi editor. While you ...

Get Inside Solaris™ 9 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.