From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11263 invoked by alias); 13 Oct 2015 05:25:02 -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: 20749 Received: (qmail 26566 invoked from network); 13 Oct 2015 05:25:01 -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-Authority-Analysis: v=2.1 cv=T/C1EZ6Q c=1 sm=1 tr=0 a=TDXRqai3AtB4qfuLBL55xA==:117 a=TDXRqai3AtB4qfuLBL55xA==:17 a=N659UExz7-8A:10 a=59ou_H4JWP_HgsiKhcUA:9 a=pILNOxqGKmIA:10 Message-id: <561C95A9.7020508@eastlink.ca> Date: Mon, 12 Oct 2015 22:24:57 -0700 From: Ray Andrews User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-version: 1.0 To: zsh-users@zsh.org Subject: Re: subsitutions and beginning of lines. 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> In-reply-to: <151012220313.ZM16595@torch.brasslantern.com> Content-type: text/plain; charset=windows-1252; format=flowed Content-transfer-encoding: 7bit On 10/12/2015 10:03 PM, Bart Schaefer wrote: > On Oct 12, 7:50pm, Ray Andrews wrote: > } > } There's a huge section "HISTORY" > } in the man page > > There is? Where? There's "HISTORY EXPANSION" but it's all about using > "!"-references on the command line. There's a subsection on "History" > in the section about options. Where are you looking? Yup, that's it. > > } but it doesn't mention that and I'll probably > } have to eat my hat when you show me that it does. > > This is in "man zshbuiltins" under the "fc" command (to which the > "history" builtin's doc directs you). Ooops, so it does. Still a brief summary of history specific switches would be friendly. 'fc' in it's totality is a bit intimidating. BTW Bart, the way I was trying to do it was educational so I don't regret it, and I think my question is still a useful exercise: how would we do that if there was no easy way? Combining the words results in a 'command not found' error, since it seems to want to believe that 'history -10 | ....' is one command so I hafta leave the words unmagically joined yet the normal thing seems to be to strip spaces down to a single one when making an array, and that's a problem with the methods I was trying. I don't doubt it's easy if you get the incantation exactly right. It doesn't help that all this splitting is invisible. As you pointed out: > eval history -n $nnumber $sstring ... is a easy as pie so long as there's no need to massage the output, but even if you do, I'm betting it's still only a couple of lines. Of course there's sed, but I'm banking on an internal solution. >