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.
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 "/".
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.