1755755 Members
3259 Online
108838 Solutions
New Discussion юеВ

Re: Console terminal

 
DAVID SIMPSON_2
Occasional Contributor

Console terminal

when using the main console or in fact logged in as root I am not able to use the handy esc and k which repeats the previous commands. Can anyone give me a hint on what to set. Running HP-UX 10.10 on Hp9000 K220. Thanks
Life is like a box of chocolates
5 REPLIES 5
Dan Hetzel
Honored Contributor

Re: Console terminal

Hi,

If I remember well, HISTSIZE defauts to 0 for root.
Make sure HISTFILE is set to /.sh_history
and HISTSIZE to some positive integer (i.e. 256).
Make sure your shell is in vi editing mode 'set -o vi'

Regards,

Dan
Everybody knows at least one thing worth sharing -- mailto:dan.hetzel@wildcroft.com
Tommy Palo
Trusted Contributor

Re: Console terminal

Type:
# ksh
# set -o vi
Keep it simple
Carol Garrett
Trusted Contributor

Re: Console terminal

I believe the standard root's .profile doesnt setup anything needed to use command recall. We add the following to ours to get it working;

HISTFILE=${HOME}/.history_files/.hist.`who am i|awk '{print $1}'`.$$.`date +%d%m%y.%H%M`
HISTSIZE=1000
export HISTFILE HISTSIZE
set -o vi

or if you dont want unique history files then just set HISTFILE to $HOME/.sh_history (or whatever). We use unique history files as an audit trail as we have rootxx userids.
Kofi ARTHIABAH
Honored Contributor

Re: Console terminal

Hi this has been discussed in other threads see:

http://my1.itrc.hp.com/cm/QuestionAnswer/1,1150,0xee04a24d9abcd4118fef0090279cd0f9!0,00.html

essentially, you have to ensure that HISTFILE is defined for root - its better to set it up in the /etc/profile so that it is defined for everyone:

# echo "export HISTFILE=~/.sh_history" >> /etc/profile

logout and back in, and voila, all subsequent logins will be recorded.

also see man sh-posix
nothing wrong with me that a few lines of code cannot fix!
Rainer_1
Honored Contributor

Re: Console terminal

add these two lines into your /etc/profile or /.profile

VISUAL=vi ; export VISUAL
HISTFILE=$HOME/.sh_history ; export HSITFILE