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 Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unix script - need help 1

Status
Not open for further replies.

RP001

Programmer
May 12, 2003
15
IN
I want to write a unix script to get me the last entered command. Then attached this script to one of the cursor keys (probably up-arrow key).
Similiar to how the the up-arrow key works on the DOS command prompt.

Is there a way to do it. Please help!
 
Why not use ksh instead?

if you use for example the following command
ksh -o vi

you have the full history of commands available by hitting "esc" and then using the normal "vi" keys up/down to access the commands. You can even search for commands as you would do in "vi" with the "/".




Regards

Frederico Fonseca
SysSoft Integrated Ltd
 
Nah! It didn't work.

I did:-
ksh -o vi
ls
<esc> key

The 'esc' key did not get me anything. I was expecting 'ls' to show up.

I am using SCO UnixWare 7.1.1.

Further details will be appreciated. Thanks!
 
You have to press the <Esc> key and then the <k> letter.
Anyway, man ksh.

Hope This Help
PH.
 
Excellent! It works.

Thank you very much!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top