Answer to my own KSH history question (I got no responses)

Augustine Cano canoaf at ntvax.uucp
Sun Oct 22 04:59:44 AEST 1989


The original question: up to a point in time, every time I started a ksh,
its history started with no commands at all, when the shell was terminated,
its command history disappeared.  Then, one day, every new ksh started would
bring with it the same existing command history.  The file ~/.kshistory was
obviously being used by all ksh's, and it grew and grew.  My question was:
What had changed? why all of the sudden didn't the shells start with a blank
history?

The answer:  It turns out that the key is in the ownership and permissions
of ~/.kshistory.  The permissions of this file are rw-------, if the file
is owned by the user, it will be used by the shells.  If it is owned by root,
the shells can't access it and will therefore create a new history of their
own.  This is why .kshistory files turn up in /lost+found when crashes occur
in the latter case, and not in the former.  My guess is that ~/.kshistory
was somehow deleted and that caused the behavior change.

Augustine Cano



More information about the Comp.sys.att mailing list