ksh: how to make [up arrow] recall command history | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

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

UNIX for Dummies Questions & Answers


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 03-14-2005
BG_JrAdmin BG_JrAdmin is offline
Registered User
 
Join Date: Feb 2005
Last Activity: 2 July 2013, 12:19 PM EDT
Posts: 172
Thanks: 1
Thanked 0 Times in 0 Posts
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
Sponsored Links
    #2  
Old 03-14-2005
reborg's Avatar
reborg reborg is offline Forum Advisor  
Administrator Emeritus
 
Join Date: Mar 2005
Last Activity: 29 March 2012, 7:00 PM EDT
Location: Ireland
Posts: 4,464
Thanks: 0
Thanked 10 Times in 10 Posts
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
The Following User Says Thank You to reborg For This Useful Post:
dariyoosh (03-02-2014)
Sponsored Links
    #3  
Old 03-15-2005
BG_JrAdmin BG_JrAdmin is offline
Registered User
 
Join Date: Feb 2005
Last Activity: 2 July 2013, 12:19 PM EDT
Posts: 172
Thanks: 1
Thanked 0 Times in 0 Posts
I like vi as my editor.

can i do this with vi?
    #4  
Old 03-15-2005
Perderabo's Avatar
Perderabo Perderabo is online now Forum Staff  
Unix Daemon (Administrator Emeritus)
 
Join Date: Aug 2001
Last Activity: 24 April 2014, 12:18 PM EDT
Location: Ashburn, Virginia
Posts: 9,838
Thanks: 42
Thanked 382 Times in 227 Posts
This doesn't change your editor, it puts ksh into emacs mode. And no you can't do this with ksh in vi mode.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how to set top arrow to get the history of last used commands etldev UNIX for Dummies Questions & Answers 3 08-07-2011 12:13 AM
Arrow Keys in read command. nr_shan Shell Programming and Scripting 2 09-30-2010 11:22 AM
AIX bash history recall gwfay UNIX for Dummies Questions & Answers 7 11-09-2009 06:57 PM
Is there any way to make up arrow show last command in CSh? sayeo Shell Programming and Scripting 5 03-22-2008 11:33 AM
i am not able to recall the command typed earlier in unix murli1200 UNIX for Advanced & Expert Users 1 08-24-2006 02:52 PM



All times are GMT -4. The time now is 12:29 PM.