From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9755 invoked from network); 14 Aug 2000 18:05:14 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 14 Aug 2000 18:05:14 -0000 Received: (qmail 17873 invoked by alias); 14 Aug 2000 18:04:40 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 3371 Received: (qmail 17825 invoked from network); 14 Aug 2000 18:04:38 -0000 From: "Bart Schaefer" Message-Id: <1000814180429.ZM10088@candle.brasslantern.com> Date: Mon, 14 Aug 2000 18:04:29 +0000 X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-users@sunsite.auc.dk Subject: Execute a command *after* reading $HISTFILE MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii My turn to ask a question. When zsh starts up, reading the history file is the very last thing that it does before entering the main interaction loop. When zsh exits normally, it first writes the history, then reads .zlogout, and finally runs the traps. I have a situation where I'd like to read a different history file at startup than is written-to at exit. I can't simply call `fc -R' from one of the startup files, because zsh will still read $HISTFILE and then I'll have loaded both histories (and part of the one that I really wanted may be lost if $HISTSIZE is reached). It would almost work to call `fc -A' from .zlogout, but that gets into all sorts of weird issues with incremental history. What I really want is to change $HISTFILE after zsh reads it. Can anyone think of anything better than the following? HISTFILE=~/.zhistory.$private eval "function precmd() { HISTFILE=~.zhistory.shared function $(functions precmd) }" The problem with this, of course, is that if it's in .zlogin it doesn't get installed in all interactive shells, but if it's in .zshrc then I have to be careful not to change precmd again in .zlogin. Suggestions? -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net