DOCUMENT ID: 1180-02
SYNOPSIS: Is there command-line history available for Solaris for x86?
OS RELEASE: 2.x
PRODUCT: Solaris x86
KEYWORDS: command-line history Korn Bourne C Shell ksh sh csh
SYMPTOMS:
There does not appear to be any command-line history available.
DESCRIPTION:
Command-line history is not available under the default Bourne Shell
(sh). It *is* available under both the Korn Shell (ksh) and the C Shell
(csh).
SOLUTION:
To enable command-line history under ksh, do the following:
1) exec ksh # Spawn a Korn Shell
2) HISTSIZE=2048 # Specify how much history to keep
3) EDITOR=vi # Create & export the necessary
4) FCEDIT=/usr/bin/vi # environment pointers
5) export EDITOR FCEDIT HISTSIZE
To use the newly-enabled command-line history, hit the key. The
standard vi "up/down" keys, j & k, can now be used to step "up & down"
through the command-line history. Hitting on any line will
execute it. If you wish, the standard vi "right/left" keys, h & l, can
be used to move the cursor within the selected line, where it can be
edited like any line in the vi editor.
To enable command-line history under csh, do the following:
1) exec csh # spawn a C Shell
2) % set prompt='\! >' # command-line prompt list command by
number
3) 1> set history=20 # how many commands to remember
4) 2> set savehist=20 # how many commands to save at logout.
To execute the previous command, type '!' and hit return. To execute a
command from the history list, enter 'history' and press .
Identify the command by its number in the history. Enter '!' to
execute that command.
DATE APPROVED: 10/10/95