Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Command history in mksh shell?

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
bedtime
Posts: 146
Joined: 2012-12-16 19:34
Has thanked: 1 time
Been thanked: 6 times

Command history in mksh shell?

#1 Post by bedtime »

When I speak of 'command history', I speak of being able to press the <up> or <down> keys to retrieve the last command entered into the terminal—even after the session has been ended. Currently, I have no way to retrieve the past commands via <up> and <down> arrow keys, which is quite costly for me. I've endured this for a few months, and now it's time to fix it if possible.

I've checked the man pages. I've scoured the net with several different search terms. There is info on ksh and other shells, but I've yet to find any info on mksh specifically.

I should add that the history works fine while in a session, but once I exit and reenter the mksh shell, they are gone; the arrow keys bring up nil. I want such to persist if possible.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: Command history in mksh shell?

#2 Post by Head_on_a_Stick »

Code: Select all

set -o emacs
^ Add that to ~/.mkshrc (or copy the supplied example mkshrc over to $HOME).

Set $HISTFILE to maintain a persistent history.
deadbang

bedtime
Posts: 146
Joined: 2012-12-16 19:34
Has thanked: 1 time
Been thanked: 6 times

Re: Command history in mksh shell?

#3 Post by bedtime »

Head_on_a_Stick wrote:

Code: Select all

set -o emacs
^ Add that to ~/.mkshrc (or copy the supplied example mkshrc over to $HOME).

Set $HISTFILE to maintain a persistent history.
Thanks. Working great now!

Post Reply