From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23238 invoked by alias); 15 Dec 2014 16:14:23 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 19542 Received: (qmail 16088 invoked from network); 15 Dec 2014 16:14:20 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=D9vw8UVm c=1 sm=1 tr=0 a=FT8er97JFeGWzr5TCOCO5w==:117 a=kj9zAlcOel0A:10 a=q2GGsy2AAAAA:8 a=oR5dmqMzAAAA:8 a=-9mUelKeXuEA:10 a=A92cGCtB03wA:10 a=puqbKHXztkyD4yM6pQAA:9 a=CjuIK1q_8ugA:10 From: Bart Schaefer Message-id: <141215081440.ZM25053@torch.brasslantern.com> Date: Mon, 15 Dec 2014 08:14:40 -0800 In-reply-to: Comments: In reply to Rocky Bernstein "Re: An example of writing a custom history file?" (Dec 15, 9:26am) References: <141214185332.ZM24112@torch.brasslantern.com> <141215003717.ZM24212@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Subject: Re: An example of writing a custom history file? MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Dec 15, 9:26am, Rocky Bernstein wrote: } } Almost there! The only remaining problem is now how write the accumulated } history. For that, I assume I use fc -W *filename* or fc -A *filename*. I don't really mind helping you out here, but if you were to actually read the documentation for the "fc" command or even look more closely at the way it's used in sticky-note you should be able to figure this out for yourself. } #!/usr/bin/zsh } fc -ap /tmp/example_history 1000 You need to supply another argument to "fc -ap" telling it what the maximum size of the saved file is. Then that number of lines will be saved automatically when the current function goes out of scope.