To use the DOSKEY functionality on the HP-UX, in your environment or execute on terminal
Code:
set -o vi |
Then you hit escape then with 'k' and 'j' scroll commands (up and down ,like in vi editor).
Then you can use the keystroke sequence <esc>/k to present the last command typed for editing. Move backwards or forwards through the command history using the "-" or "+" keys respectively. If you find a command you want to edit, type "v" which will invoke "vi". Then after editing, use the usual ":wq!" to exit vi and the edited command will execute.
Tip: If you decide to not execute any command (edited or not), blank the command in vi (eg. the "dd" vi command) and then ":wq!".