From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by coral.primenet.com.au (8.7.5/8.7.3) with ESMTP id HAA02620 for ; Mon, 19 Aug 1996 07:03:15 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id RAA12581; Sun, 18 Aug 1996 17:05:25 -0400 (EDT) Resent-Date: Sun, 18 Aug 1996 17:00:43 -0400 (EDT) From: "Bart Schaefer" Message-Id: <960818140140.ZM24453@candle.brasslantern.com> Date: Sun, 18 Aug 1996 14:01:39 -0700 In-Reply-To: "Timothy J. Luoma" "using 'fc' to backup 'zhistory (was Re: saving history file based on # of commands)" (Aug 15, 11:11pm) References: <199608160311.XAA14070@nerc.com> Reply-To: schaefer@nbn.com X-Mailer: Z-Mail (4.0b.729 29jul96) To: luomat@nerc.com, zsh-users@math.gatech.edu Subject: Re: using 'fc' to backup 'zhistory (was Re: saving history file based on # of commands) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"O-uv-3.0.I33.wHu5o"@euclid> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/363 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Aug 15, 11:11pm, Timothy J. Luoma wrote: } Subject: using 'fc' to backup 'zhistory (was Re: saving history file base } } Someone suggested that I use 'fc' and precmd to call a function to } backup my zhistory file. What's wrong with: function precmd { fc -AI $HISTFILE } This adds every command to your histfile as you type it, and lops off everything before the last $SAVEHIST entries. Or is that what you say takes too long? } However, I cannot figure out how to do this (I keep ending up with } a size=0 file). fc -W and fc -A always truncate to SAVEHIST entries, so if you don't have SAVEHIST set to something greater than zero, nothing will be written. Could that be what's happening? } backup the _last_50 commands I have entered (otherwise it gets very } slow waiting for the entire history file to be backed up, and once } I have it, I'd rather just add to it than start all over each 50 } commands). Try this in 3.0.0: function precmd { SAVEHIST=50 fc -AI $HISTFILE # Use -WI if this doesn't seem right } -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.nbn.com/people/lantern New male in /home/schaefer: >N 2 Justin William Schaefer Sat May 11 03:43 53/4040 "Happy Birthday"