ksh: how to make [up arrow] recall command history


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers ksh: how to make [up arrow] recall command history
# 1  
Old 03-14-2005
ksh: how to make [up arrow] recall command history

I want to get my up arrow key to recall my previous commands in Korn shell.
Anyone help please?

thanks a bunch!

BG
# 2  
Old 03-14-2005
add the following
lines to the bottom of your .kshrc file in your $HOME directory:

set -o emacs
alias __A=$(print '\0020') # ^P = up = previous command
alias __B=$(print '\0016') # ^N = down = next command
alias __C=$(print '\0006') # ^F = right = forward a character
alias __D=$(print '\0002') # ^B = left = back a character
alias __H=$(print '\0001') # ^A = home = beginning of line
These 3 Users Gave Thanks to reborg For This Post:
# 3  
Old 03-15-2005
I like vi as my editor.

can i do this with vi?
# 4  
Old 03-15-2005
This doesn't change your editor, it puts ksh into emacs mode. And no you can't do this with ksh in vi mode.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

[ksh] how to reload history file without entering a command

I'm basically looking for the ksh equivalent of bash's PROMPT_COMMAND="history -r", where simply redrawing the command prompt in a terminal will cause ksh to reload the history file. At the risk of sounding incredibly lazy (in which case I would be guilty as charged), I've noticed that if I have... (13 Replies)
Discussion started by: DevuanFan
13 Replies

2. Shell Programming and Scripting

UP arrow button to recall previous commands in Putty

Hi, I remember in my previous project, I used UP arrow button to recall previous unix commands (using putty on Sun OS), which I am not able to do in my new project... I do not know if this is some project specific settings or not... when I press UP arrow button, all I get is ^. I have to... (3 Replies)
Discussion started by: juzz4fun
3 Replies

3. Shell Programming and Scripting

up down arrow key and edit on command line.

I am using ksh, By doing change in .profile as set -o vi my updown and history does not work. Also I can not edit command line on prompt using vi command. My TERM is vt100. What is wrong here ? Thanks. :cool: (3 Replies)
Discussion started by: ekb
3 Replies

4. UNIX for Dummies Questions & Answers

how to set top arrow to get the history of last used commands

guys can any one help me how to set top arrow to get the history of last used commands.I am using ksh (3 Replies)
Discussion started by: etldev
3 Replies

5. Shell Programming and Scripting

What is the ksh equivalent to bash's "history -c" command?

Hi, What is the korn shell equivalent of bash shell's "history -c" command? I do know, how to clear the history list in ksh, I can do the following: > ~/.sh_historybut still, I am interested to know the single one line command as 'history -c' gives error on my ksh (1 Reply)
Discussion started by: royalibrahim
1 Replies

6. UNIX for Dummies Questions & Answers

AIX bash history recall

Is it possible to use the keyboard UP ARROW in place of k to recall history? If so, how/what do I need to do change terminal emulation, etc.? TIA, George (7 Replies)
Discussion started by: gwfay
7 Replies

7. UNIX and Linux Applications

command scrolling using arrow keys

hi, can anyone tell me how to enable arrow keys to scroll thru the commands on command prompt. I am using C shell ( I know, in k shell, set -o vi would enable vi command history, but set -o doesnte exist in c shell) (4 Replies)
Discussion started by: hemangi13
4 Replies

8. Shell Programming and Scripting

Is there any way to make up arrow show last command in CSh?

Hi, I've been looking for a way to make the up arrow show the last command in csh, like how it does in bash/ksh. I've been googling and just can't find anything.....anybody have any ideas? thanks! (5 Replies)
Discussion started by: sayeo
5 Replies

9. UNIX for Advanced & Expert Users

i am not able to recall the command typed earlier in unix

i am not able to recall the command typed earlier in unix whenever i press esc key ^[ comes on the unix prompt . so esc k isnt working for me whenever i press backspace key i get ^H on my unix cursor need help (1 Reply)
Discussion started by: murli1200
1 Replies

10. News, Links, Events and Announcements

DARPA contestants make robotic history

DARPA contestants make robotic history http://news.com.com/Driverless+robots+reach+milestone+in+DARPA++race/2100-11394_3-5891793.html?tag=nl (3 Replies)
Discussion started by: Neo
3 Replies
Login or Register to Ask a Question