Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!pacbell.com!pacbell!boo!mtdiablo!rob From: rob@mtdiablo.Concord.CA.US (Rob Bernardo) Newsgroups: comp.unix.shell Subject: Re: KSH: How to set env var HISTFILE ? Message-ID: <1991May14.135223.28963@mtdiablo.Concord.CA.US> Date: 14 May 91 13:52:23 GMT References: <1991May10.204042.25982@noose.ecn.purdue.edu> Organization: Mt. Diablo Software Solutions Lines: 31 luj@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@mtdiablo.Concord.CA.US phone: (415) 827-4301