[SATLUG] re: Recall History

Craig sargonemail at gmail.com
Wed Apr 15 20:25:33 CDT 2015


For the vi group,

set -o vi

will work in place of emacs.

Craig



On Wed, Apr 15, 2015 at 8:24 PM, Craig <sargonemail at gmail.com> wrote:

> Without switching to bash:
>
> For the arrow keys, in your login profile
> export ENV=$HOME/.kshrc
>
> in your .kshrc add this:
>
> case $- in
> *i*)    #interactive ksh
>   # This  stuff lets the arrow keys work in an xterm...
>   set -o emacs
>   alias __A=`echo "\020"`     # up arrow == ^p == back a command
>   alias __B=`echo "\016"`     # dn arrow == ^n == down a command
>   alias __C=`echo "\006"`     # rt arrow == ^f == forward a character
>   alias __D=`echo "\002"`     # lf arrow == ^b == back a character
> esac
>
>
>
> On Wed, Apr 15, 2015 at 8:17 PM, Craig <sargonemail at gmail.com> wrote:
>
>> Steve Kolars wrote:
>> > Please help, I have lost my memory: what is the program that gives the up
>> > and down arrows functionality to recall history at the command line?
>> Time to to upgrade to magnetic ram?
>> Assuming that your not using a Ronald Reagan version of ksh (e.g. earlier than ksh93)
>> and/or echo-ing history to /dev/null adding the the alias' below to .profile (& resource-ing .profile) should work.
>>
>> *> Borris Demeler wrote:
>> *> that should be part of bash. If you use the bash shell, don't you have up/down arrow functionality?
>> "# passwd -e $" or just adding "# exec /bin/bash" to .profile also had the side benefit of having to type less. ;)
>>
>> Craig
>>
>> ========================================================
>> set -o emacs
>>
>> Note: these are the actual control characters. In vi, type i ctrl-v then
>> ctrl-P (if u want a ctrl-p)
>>
>> alias _A=^P
>> alias _B=^N
>> alias _D=^B
>> alias _C=^F
>>
>> and add below lines too:
>>
>> alias __A=^P
>> alias __B=^N
>> alias __D=^B
>> alias __C=^F
>>
>>
>


More information about the SATLUG mailing list