Unix/Linux Go Back    


UNIX for Dummies Questions & Answers This forum is closed for new posts. Please post beginner questions to learn unix and learn linux in this forum UNIX for Beginners Questions & Answers

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

UNIX for Dummies Questions & Answers


 
 
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: 20 August 2015, 1:28 PM EDT
Posts: 179
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 (05-30-2015)
Sponsored Links
    #3  
Old Unix and Linux 03-15-2005
BG_JrAdmin BG_JrAdmin is offline
Registered User
 
Join Date: Feb 2005
Last Activity: 20 August 2015, 1:28 PM EDT
Posts: 179
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: 26 February 2016, 12:31 PM EST
Location: Ashburn, Virginia
Posts: 9,931
Thanks: 64
Thanked 461 Times in 267 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
 

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
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 07:08 AM.