1827444 Members
5617 Online
109965 Solutions
New Discussion

no .sh_history file

 
joseph wholey
Regular Advisor

no .sh_history file

I'm running RHEL AS3. My users are set up to use /bin/ksh. However, there is no .sh_history being created for any of them of the users. Nothing is setup in either the /etc/profile or the respective /home//.profile which is creating the file somewhere else. If I issue "history" as a user, it will display command history for current session. My question is: "WHY ISN'T A .sh_history FILE CREATED"????? Shouldn't that happen by default? Please respond if you can address the PROBLEM. No work around recommendations please!!!! thx.
5 REPLIES 5
Jeff_Traigle
Honored Contributor

Re: no .sh_history file

For ksh, HISTFILE should be defined. If it's not, no history file is used. See ksh man page. Put the following in /etc/profile:

HISTFILE=${HOME}/.sh_history
--
Jeff Traigle
Robert-Jan Goossens
Honored Contributor

Re: no .sh_history file

Hi,

Your korn shell uses a deafult buffer for the last commands. If you would like to setup a history file, you will need to add this to your .profile or /etc/profile.

EDITOR=vi
HISTFILE=${HOME}/.sh_history_`who am i|awk '{ print $1}'`
HISTSIZE=1000
export EDITOR HISTFILE HISTSIZE

Best regards,
Robert-Jan
Steven E. Protter
Exalted Contributor

Re: no .sh_history file

Shalom joseph,

This is a Linux system.

It does not use the .sh_history file.

Take a look at $HOME/.bash_history

You will see what you would expect in .sh_history

You CAN have .sh_history if you want, but most Linux admins (like me) will if they touch the system look for a .bash_history file.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Pete Randall
Outstanding Contributor

Re: no .sh_history file

joseph wholey
Regular Advisor

Re: no .sh_history file

Sorry... I'm using /bin/ksh as my default shell. I was under the impression (actually I believe I read it somewhere) that by default .sh_history will be created. On all of my AIX machines, I do not define .sh_history in my .profile or in /etc/profile, however, it does get created. Please advise. thx.