Operating System - HP-UX
1753734 Members
4760 Online
108799 Solutions
New Discussion юеВ

Help !!! to understand history command configuration

 
ben10_1
Regular Advisor

Help !!! to understand history command configuration

Hello forum,

I have a HPUX11.23 server.
more /.sh_history shows the entered command by root. ( ksh is the default shell)

In the /.profile I can't see any parameters related to History!!! HISTFILE and HISTSIZE are not there.

How come the history commands are working???
To my understanding since the HISTFILE and HISTSIZE are not set in the .profile the history command should not work!!!

You help is needed guys,
14 REPLIES 14
ben10_1
Regular Advisor

Re: Help !!! to understand history command configuration

I meant with history command : Esc-k

This shows me the previous entered command.
Pete Randall
Outstanding Contributor

Re: Help !!! to understand history command configuration

Try doing a man on ksh. It will tell you that the default for HISTFILE is $HOME/.sh_history and the default for HISTSIZE is 128.

There, now was that so hard?


Pete

Pete
Pete Randall
Outstanding Contributor

Re: Help !!! to understand history command configuration

By the way, it is generally not recommended to change root's shell from the usual posix shell. The korn shell for example lives in /usr/bin, which would not be mounted when you need to come up in single user mode.


Pete

Pete
ben10_1
Regular Advisor

Re: Help !!! to understand history command configuration

Hello Pete,

The issue is that to my understanding the history should not be working since no one has set the HISTFILE and HISTSIZE in the .profile.

Now the .sh_history shows the executed commands, although no one has configured it to do so??

For me that's strange.
Pete Randall
Outstanding Contributor

Re: Help !!! to understand history command configuration

Perhaps before checking the man page you should spend a minute with a dictionary, looking up "default".


Pete

Pete
ben10_1
Regular Advisor

Re: Help !!! to understand history command configuration

Problem solved,

For some reason,only after rebooting the server the configuration in the .profile are applied correctly, whether it was the default or a customized history.

Now the behavior is reflecting the configuration.
James R. Ferguson
Acclaimed Contributor

Re: Help !!! to understand history command configuration

Hi:

> For some reason,only after rebooting the server the configuration in the .profile are applied correctly,

You used a sledge hammer. Apologize to your poor users. All that was necessary was to log-out and log back in to see if your newly modified profile satisfied your need.

...JRF...
Dennis Handly
Acclaimed Contributor

Re: Help !!! to understand history command configuration

>How come the history commands are working?
>To my understanding since the HISTFILE and HISTSIZE are not set in the .profile the history command should not work!

This only applies as a security measure to the Posix shell for root.

>Pete: it is generally not recommended to change root's shell from the usual posix shell.

Stronger than than that, your system will not work correctly, especially when you reboot or in single user mode.

Michael Steele_2
Honored Contributor

Re: Help !!! to understand history command configuration

a) See Pete Randall's reply:

"...Try doing a man on ksh. It will tell you that the default for HISTFILE is $HOME/.sh_history and the default for HISTSIZE is 128...."

You enter HISTFILE or HISTSIZE in .profile when you want to change the DEFAULT!!!!

Else, the default is compiled into ksh.

b) Second, see Pete Randall's reply about not changing roots default shell from posix to korn, unless you want a big surprise and an unbootable system. (* perhaps you just mistated that you had changed root's shell ? *)
Support Fatherhood - Stop Family Law