From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28919 invoked from network); 29 Feb 2008 16:44:04 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 29 Feb 2008 16:44:04 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 67677 invoked from network); 29 Feb 2008 16:43:43 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 29 Feb 2008 16:43:43 -0000 Received: (qmail 7809 invoked by alias); 29 Feb 2008 16:43:32 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12661 Received: (qmail 7795 invoked from network); 29 Feb 2008 16:43:32 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 29 Feb 2008 16:43:32 -0000 Received: from vms042pub.verizon.net (vms042pub.verizon.net [206.46.252.42]) by bifrost.dotsrc.org (Postfix) with ESMTP id 68456802720E for ; Fri, 29 Feb 2008 17:43:25 +0100 (CET) Received: from torch.brasslantern.com ([71.121.18.67]) by vms042.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0JX000IYXEG03HJ3@vms042.mailsrvcs.net> for zsh-users@sunsite.dk; Fri, 29 Feb 2008 10:43:13 -0600 (CST) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id m1TGhBOH017551 for ; Fri, 29 Feb 2008 08:43:12 -0800 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id m1TGhA8Y017550 for zsh-users@sunsite.dk; Fri, 29 Feb 2008 08:43:10 -0800 Date: Fri, 29 Feb 2008 08:43:10 -0800 From: Bart Schaefer Subject: Re: Editing history stack during runtime? In-reply-to: <2d460de70802281709n1847611cp6cb9a5273e212bae@mail.gmail.com> To: "zsh users" Message-id: <080229084310.ZM17549@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: <2d460de70802281709n1847611cp6cb9a5273e212bae@mail.gmail.com> Comments: In reply to "Richard Hartmann" "Editing history stack during runtime?" (Feb 29, 2:09am) X-Virus-Scanned: ClamAV 0.91.2/6045/Fri Feb 29 17:19:36 2008 on bifrost X-Virus-Status: Clean On Feb 29, 2:09am, Richard Hartmann wrote: } } is there a way to stuff all my local history (i.e. from from hist files) } into $EDITOR, edit it and put back whatever I save to it? There are a couple of different things you might mean by this, so I'm not sure how to answer. Does "put back" mean "keep in $HISTFILE" (for the next shell that starts) or does it mean "load immediately"? And does "local history" mean "most current history of this shell" or does it simply mean whatever is in $HISTFILE at the moment? If you don't have INC_APPEND_HISTORY set and you want the most recent history of the current shell, you need to write the file first with "fc -W". That might get into complications if SAVEHIST and HISTSIZE have different values. Then you can simply run "$EDITOR $HISTFILE", and finally re-read it with "fc -R". However, if you have SHARE_HISTORY set, then editing the file in place may not be a good idea, so there's no way to give you a direct answer without knowing what end result you want. Then there are the added complications of EXTENDED_HISTORY, which puts things in $HISTFILE you have to be careful about editing (it's still all just text, though). You can arrange to strip those so that you can edit without breaking anything, but then when you rewrite the file you'll lose all that information. So ... if this doesn't tell you enough to get where you want to be, you're going to have to ask a more specific question.