Operating System - HP-UX
1834639 Members
2564 Online
110069 Solutions
New Discussion

Re: monitoring history log

 
SOLVED
Go to solution
mohd hashimi
Occasional Contributor

monitoring history log

hi to all ...

i need to know how to trigger history here ...
when everytime at the prompt i press ESC-K i cant get the command i type before ..

thank you ..
3 REPLIES 3
Bill Hassell
Honored Contributor
Solution

Re: monitoring history log

This is the command recall feature of POSIX type shells such as ksh and HP's /usr/bin/sh. Put these 3 lines in /etc/profile so that all users will have the same feature:

export HISTFILE=$HOME/.sh_history
export HISTSIZE=1000
export EDITOR=/usr/bin/vi

Then login again, type a command like pwd and then ESC-K to recall. Use the built-in alias history to see the last few lines. Recall a line by searching for some string with ESC-/some_string. It will be displayed for editing with vi-style commands, and return to run the command.


Bill Hassell, sysadmin
Dennis Handly
Acclaimed Contributor

Re: monitoring history log

>Bill: Put these 3 lines in /etc/profile ...

You also need to use: set -o vi
mavrick
Regular Advisor

Re: monitoring history log

Hi,

You can try by

set -o vi

this will set your command line environment.