KSH: How to set env var HISTFILE ?

Rob Bernardo rob at mtdiablo.Concord.CA.US
Tue May 14 23:52:23 AEST 1991


luj at gus19.ecn.purdue.edu (Jun Lu) wrote:
>Should I set env var HISTFILE in .profile or in $ENV file ?
>I think that in a wndowing environment, it's better to set HISTFILE in $ENV
>file so that each window/shell has its own HISTFILE. 
>
>What puzzels me is that I cannot find those $HISFILE(and from time to time
>ksh messes up command histories in different shells). See the following:
...
>
>Can anyone tell me what goes wrong ?  I'm using ksh Version 11/16/88e on a
>Sun workstation running SunOS4.x and X11 R4.

I'm in the exact same environment and have the same motivation. I set
mine up in my $ENV file and it works just fine. Are you sure that
you are making HISTFILE an environmental variable and not just a plain ol'
shell variable? That would explain why your HISTFILE has a value but is
not used.

Btw, the lines from my env file, to be on a one-HISTFILE-per-window basiset are:

-a
HISTFILE=$HOME/.sh_hist_$(basename $(tty))
...
set +a

By naming them with the tty name, the histfiles remain between login sessions.
In one environment, where I often rlogin to other systems, I also put the
hostname in the HISTFILE value.
-- 
Rob Bernardo					Mt. Diablo Software Solutions
email: rob at mtdiablo.Concord.CA.US		phone: (415) 827-4301



More information about the Comp.unix.shell mailing list