The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



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 !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Previous command new2ss HP-UX 5 02-14-2008 06:06 AM
Previous Command vskr72 UNIX for Dummies Questions & Answers 2 04-20-2007 11:03 AM
Previous Command vskr72 Shell Programming and Scripting 1 04-19-2007 07:04 PM
Previous Command vskr72 UNIX for Advanced & Expert Users 0 04-19-2007 06:51 PM
Seeing previous command JackieChan UNIX for Dummies Questions & Answers 4 06-02-2006 09:35 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-16-2005
luft luft is offline
Registered User
  
 

Join Date: Mar 2005
Posts: 45
getting the previous command

Hello all

I'm on SunOS5.9 and I'm trying to make the arrow keys work as in DOS ..get the previous command , etc .. I searched this site and got an answer. I pasted the following code to my .kshrc file in my home directory...It still does not seem to work ...Am I missing anything here ?

I'm using Ksh ....

added the following lines to the bottom of your .kshrc file in my $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


Thanks
  #2 (permalink)  
Old 08-16-2005
98_1LE 98_1LE is offline Forum Advisor  
Registered User
  
 

Join Date: Dec 2000
Location: Greater Dallas area
Posts: 405
The arrow keys will work like DOS in bash.

In ksh you can put "set -o vi" in your profile or run it for that session, and you can ESCAPE-K back thru your commands.

I am not sure how to do what you want.
  #3 (permalink)  
Old 08-16-2005
reborg's Avatar
reborg reborg is offline Forum Staff  
Administrator
  
 

Join Date: Mar 2005
Location: Ireland
Posts: 4,206
Quote:
Originally Posted by luft
I added the following lines to the bottom of your .kshrc file in my $HOME
.kshrc is not used in Solaris by default, you will need to put the aliases in .profile, or set your ENV variable appropriately.
  #4 (permalink)  
Old 08-17-2005
luft luft is offline
Registered User
  
 

Join Date: Mar 2005
Posts: 45
getting the previous command

Thanks to both of you for your inputs ...

Reborg

I implemented your solution ..worked like a charm..One question though..one of my accounts has a default shell of /bin/sh (Bourne Shell).I
pasted the aliases in both .profile as well as .kshrc but it does NOT seem to work...Please advise ...

OS : SunOS5.9
Shell : /bin/sh

Thanks
  #5 (permalink)  
Old 08-17-2005
reborg's Avatar
reborg reborg is offline Forum Staff  
Administrator
  
 

Join Date: Mar 2005
Location: Ireland
Posts: 4,206
For that account you are out of luck, Bourne shell does not support this behaviour at all.
  #6 (permalink)  
Old 08-18-2005
luft luft is offline
Registered User
  
 

Join Date: Mar 2005
Posts: 45
Getting the previous command

Thanks reborg ...In that case, I'll request my administrator to change my shell to ksh ...
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:46 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0