1847076 Members
5151 Online
110262 Solutions
New Discussion

Re: POSIX shell

 
SOLVED
Go to solution
Allan Pincus
Frequent Advisor

POSIX shell

I thought ESC-K was native to the POSIX shell, and I could use it to repeat command history?

It does not seem to work. If I do:

/usr/bin/ksh
set -o vi

Then I can get the history to work, but I want to use

/usr/bin/sh

What's going on?
3 REPLIES 3
James R. Ferguson
Acclaimed Contributor
Solution

Re: POSIX shell

Hi Allan:

Make sure your $HOME/.profile has:

# export EDITOR=vi
# export HISTFILE=$HOME/.sh_history

Regards!

...JRF...
John Poff
Honored Contributor

Re: POSIX shell

Hi,

You'll need to set the HISTFILE and HISTSIZE environment variables. The HISTFILE contains the shell history filename, and the HISTSIZE is the number of commands to keep in the file, default is 128.

JP
Jeff Schussele
Honored Contributor

Re: POSIX shell

Hi Allan,

Make sure you set EDITOR=vi & HISTFILE=$HOME/.sh_history in your .profile and export THEM.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!