Unix/Linux 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 Linux or Unix Question    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 03-14-2005
BG_JrAdmin BG_JrAdmin is offline
Registered User
 
Join Date: Feb 2005
Last Activity: 10 June 2015, 10:53 AM EDT
Posts: 177
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 Unix and Linux 03-14-2005
reborg's Unix or Linux Image
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 12 Times in 11 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 2 Users Say Thank You to reborg For This Useful Post:
dariyoosh (03-02-2014), Neo (4 Weeks Ago)
Sponsored Links
    #3  
Old Unix and Linux 03-15-2005
BG_JrAdmin BG_JrAdmin is offline
Registered User
 
Join Date: Feb 2005
Last Activity: 10 June 2015, 10:53 AM EDT
Posts: 177
Thanks: 1
Thanked 0 Times in 0 Posts
I like vi as my editor.

can i do this with vi?
    #4  
Old Unix and Linux 03-15-2005
Perderabo's Unix or Linux Image
Perderabo Perderabo is offline Forum Staff  
Unix Daemon (Administrator Emeritus)
 
Join Date: Aug 2001
Last Activity: 27 April 2015, 10:26 AM EDT
Location: Ashburn, Virginia
Posts: 9,931
Thanks: 64
Thanked 447 Times in 264 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 Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux 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 08:02 PM.