Operating System - HP-UX
1751926 Members
5264 Online
108783 Solutions
New Discussion юеВ

Re: Shell history not being written to specified history file

 
Brett Simpson
Frequent Advisor

Re: Shell history not being written to specified history file

Pete,
I believe it's running .profile since the variables I defined there are being assigned.

Brett Simpson
Frequent Advisor

Re: Shell history not being written to specified history file

Dennis,
Very near the top of .profile.
Peter Nikitka
Honored Contributor

Re: Shell history not being written to specified history file

Hi,

do once a
touch $HISTFILE
and re-login.
Then check for updates of this file.

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
Brett Simpson
Frequent Advisor

Re: Shell history not being written to specified history file

Peter,
I just tried that with the same results. Still just getting the date that I logged in.
Dennis Handly
Acclaimed Contributor

Re: Shell history not being written to specified history file

>Still just getting the date that I logged in.

Throw everything in your .profile away.
Just have:
export HISTFILE=$HOME/.${LOGNAME}_history
export HISTFILE=500
date >> $HISTFILE

See if this works.

Ah, you absolutely can't do this:
date >> $HISTFILE

The shell history file is a binary file and you can't fiddle with it.
And I don't really see how to get a command with a date in the history file, unless you type it in.
Brett Simpson
Frequent Advisor

Re: Shell history not being written to specified history file

Dennis,
I've tried that and it didn't work either. It wrote nothing to the $HISTFILE that I defined. If I do an echo $HISTFILE, it shows that valus that I defined.

Just keeps writing to the .sh_history file. Is there somewhere else that I need to define the history file that I want to user?
Dennis Handly
Acclaimed Contributor

Re: Shell history not being written to specified history file

>Is there somewhere else that I need to define the history file that I want to use?

No, this works fine for ksh. What shell are you using and are you talking about root?
Brett Simpson
Frequent Advisor

Re: Shell history not being written to specified history file

I'm using ksh and it's a non-root account. Here's the update:

I just created the same test user on a different server and it worked great. So, no I'm wondering if something is set up on this server that's stopping it from working. There must be some setting that's preventing it from working.
Dennis Handly
Acclaimed Contributor

Re: Shell history not being written to specified history file

>There must be some setting that's preventing it from working.

Have you removed the corrupted history file?
Is $HOME over NFS?
Brett Simpson
Frequent Advisor

Re: Shell history not being written to specified history file

Here's the lastest update:

If I login and then type ksh, then it starts logging to the correct history file. So, it appears that my ksh shell is not being invoked on login?

Any ideas?