From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1649 invoked by alias); 14 Oct 2015 00:23:46 -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: 20752 Received: (qmail 11660 invoked from network); 14 Oct 2015 00:23:44 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=67sBR5tTKsK80y+u3xMscrItDf17DFu6beOfNqQJsIQ=; b=LObxv43+s0ay9OlQVKAyKtJvXK2p6+5HyyRpKfjHCU9sweHA87meQwUxdlkvk5k1KE nvCDccYCx3rj+gWDIPorgPcNupLQXXulGU025Q2yjQquUri8zsH1MnpAJFjSEXMzAlF4 EM2QZgOM2mugXkD0QIcd+P0eA8MtRcmJLrYvCHGNIEm2Tlf6NVrBo7ZhhFrc44MhLr8P kpIa7ZB0pxsvcUFBKz0jzehXDpUYGQgKgWEVbZn4njQ/bZJ/MiLMHXBarZbUmvjB0bQn hsgAhpBUE0MvVBmv4HTRMPqQfgp5cBoZH4iINwXMEEvfZ2817vuRevSOTpOt3mk0mKi8 hfSg== X-Gm-Message-State: ALoCoQkJEEcbPS4aIhNuXIoPG3Jqbge0/EmPD+IWB86lRNeEJaoQEMgBPyrJywwPfTk45/THmIr9 X-Received: by 10.60.60.67 with SMTP id f3mr123567oer.43.1444782222643; Tue, 13 Oct 2015 17:23:42 -0700 (PDT) From: Bart Schaefer Message-Id: <151013172339.ZM30911@torch.brasslantern.com> Date: Tue, 13 Oct 2015 17:23:39 -0700 In-Reply-To: <561D7AB4.7030206@eastlink.ca> Comments: In reply to Ray Andrews "Re: subsitutions and beginning of lines." (Oct 13, 2:42pm) References: <561AB49A.4060801@eastlink.ca> <20151011210902.566de251@ntlworld.com> <561AEB2F.8030808@eastlink.ca> <20151012103455.5f6159d7@pwslap01u.europe.root.pri> <561BD55C.3080006@eastlink.ca> <561BE8DC.7060506@eastlink.ca> <151012192908.ZM15508@torch.brasslantern.com> <561C717A.1030202@eastlink.ca> <151012220313.ZM16595@torch.brasslantern.com> <561C95A9.7020508@eastlink.ca> <151013125819.ZM30782@torch.brasslantern.com> <561D7AB4.7030206@eastlink.ca> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: subsitutions and beginning of lines. MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Oct 13, 2:42pm, Ray Andrews wrote: } } BTW, is there some way of asking history not to search } thru a given number of entries, but to continue searching up to } a given number of hits? What defines a "hit" here? Your "history" command isn't "searching" AT ALL. Rather it's your series of "grep" commands that are doing the searching. There's no way an argument to the "history" command can tell it how many times "grep" of its output is going to succeed. So it sounds like what you really want is eval history -r -n -$HISTSIZE $sstring | head $nnumber That is, dump the entire history, grep it, and then show the most recent few events that match the greps.