Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DOSKEY for Solaris? 1

Status
Not open for further replies.

tech84

Technical User
May 18, 2000
126
US
I'm just learning Solaris, so as you can imagine, I sometimes have to enter a command with a long line of switches/variables more than once at times. I love the feature of DOS/Windows that allows you to instantly recall the last line of type you entered (such as hitting F3, or the up arrow). Is there anything like this in Solaris? It sure would save me a lot of typing! (Although it couldn't hurt to practice typing the same command 3 or 4 times in order for it to sink in, right? [wink])

Thanks! Mike
[morning]
 
The ksh shell gives you the facility to recall commands from the .sh_history file using vi-like keypresses (eg esc k to go backwards through the file one command at a time and esc / to search for a specific string you've used in a command previously). Other shells (eg bash) enhance this capability. HTH.
 
Hi Ken,

Are the keypress examples you supply for sparc only? I'm sitting at an Intel Solaris box here at work and none of those keypresses work. How do I find out more? man -k command history?

Thanks! Mike
[morning]
 
Hi Mike, sorry I forgot to mention that you have to issue a:

set -o vi

command to enable the vi-like features. I assume you have a ksh session active? If necessary, you can put the set -o vi in your .profile so that it's activated when you log in. Cheers.
 
Thanks, Ken! I'll give that a try and see what happens. You specify the ksh, but will this work with sh as well? Which shell do most Sys Admins prefer nowadays, anyway? Mike
[morning]
 
Mike, it won't work with the original Bourne Shell, but it will with bash, which is what I believe Scunningham99 is referring to. Cheers - holiday next week!!!!
 
Cool! I changed my shell to bash so I can use the arrows. Which shell does set -o vi work with? Mike
[morning]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top