From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,T_KAM_HTML_FONT_INVALID,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 2758 invoked from network); 18 Jul 2022 12:49:33 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 18 Jul 2022 12:49:33 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1658148573; b=i3TNpAliWATov0ZRDgadkyaKKhaNbOL8ae8OXiT3pzBNliJNn8uDwJINHVMgb9FN1Fascj8jYc KMc0thsZAdXjvwUA8k61e8dFKGV/01j3KcPztpU87YGv9S1V5d+h4pcn/l2mry+XSX7lmfGPr8 NrkxRjlWnEpwL3Mt1SRM4H5H5eODTCRLM8/b8UyIdupB2RkhTpqaEnJMCzAHUwU4rW6lLzUHIx K3GECE2Wh1CffZm1jFp+vPeSyx9Id1q5kwYu9tR1LGpNxsMUf2QB0d6teVLPh5vdV1Og2JXSq+ 6unaflmx9rpd4/3Q3XPBKrPmJIqx6+E8e0RjMqFfpOKVbw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-qv1-f52.google.com) smtp.remote-ip=209.85.219.52; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1658148573; bh=uQqmoB2+1TJhvzxG1z6fAfJKA2WHCeBFYmd7SMArDWs=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=f/tpvTNy6uBQOSpdILOSTgtZ0pNmZobu0qEdqNn+gpZrd+9joWNQ01VNG473sA6omlxb021fRQ pp15D1R/RbmJnNcrzkxfB7L7Fc9Qd2L3bX1jsU6+PmnrEfycyWvZxGglJP52CWqSQBR8g1DSP0 Y010wDIVo2vmm5sfMSsFUP8D+Sj8EWno2df5/44rz/MZxj1vzZdNYrESFguvJ75e19sWjKpiQG p/upRVqLqw3XBY1QjEHRVh/rpe8UteKDLTMeUH6lUZGDeWcvm2Qg46VmIOjWEO2dZKoRYQAarc uAqSKI4Gl4dX67VIGNNVQxTsqzlYiuSQ5SHkMSo6GGAArg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=uQqmoB2+1TJhvzxG1z6fAfJKA2WHCeBFYmd7SMArDWs=; b=KQGv9wifCBSflgK5BSt5osF/vj v1wAupWqACFZWWxcGHZDHMUV5dGPlBrgbyo68EcmjvveJhRs7aAmJk8Lq9qVYM81tEBt4lFpl9LMx y8ODURyrhpu1YqJsObrITO2sFIWHXVFSGmJuc8skXndVBEDYPSS9KJyDk7v6E2lWdLmDCkBu5WF8L nT8B+LjqQHnA+ybt1nT11voKT+FFRgXqXdjcM9YIuI7DK2GZssv1esgaIlrzQqtwwsGbRbhzbLrzc xdIdKofspUa0C6lzbVK0YaX6IGO55jlEeztwhGNsg28Vg98IqACo+vh719lJMfn71+Gf38+2Nx/Bn pyYOv3AQ==; Received: from authenticated user by zero.zsh.org with local id 1oDQBn-000AFP-3B; Mon, 18 Jul 2022 12:49:31 +0000 Authentication-Results: zsh.org; iprev=pass (mail-qv1-f52.google.com) smtp.remote-ip=209.85.219.52; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-qv1-f52.google.com ([209.85.219.52]:46917) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1oDQAX-0009XN-DP; Mon, 18 Jul 2022 12:48:14 +0000 Received: by mail-qv1-f52.google.com with SMTP id l11so8608754qvu.13 for ; Mon, 18 Jul 2022 05:48:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uQqmoB2+1TJhvzxG1z6fAfJKA2WHCeBFYmd7SMArDWs=; b=lcMWHpI3JjPVCrqlYtkAgz6zwbZK9FM+UYB4Nq6kljnenLdavQpf88m9Qw1cCMNw/t Pw0Rt1wWvRhkonr4Idh0eGVBKeu0rxQ869o6KE6ZuC6fS++MCs5OD/TO3qc81fB846eX 4wKno68spdUNlEVkPrPk3nfOvwiTF3wyRt3Vsqv3jakE4il1Ldq5PgVpUKhsGaqxvJ02 pZ5qMnJnZJAoow/9hfPbXYXneIWyOtgZpVTK1M0IfyayHoTT+kD4sYljtehju1+qB08J Q9Kco2fwCiVPPuRyH7fsPKoaI1SPr+iG3DTIGmow+P6qonh4RHnKtxeD+r5dFJQyro8v Yytg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=uQqmoB2+1TJhvzxG1z6fAfJKA2WHCeBFYmd7SMArDWs=; b=QzFjmSbbGXRWP4oo4aSagX9Lib2advftUfKpFWwDykSnpcsqsVp/N5ICt9lWfck0SS z3sGFQl6LcvsBpZf82E79pONdcZMG3GZitDe+ogA3NE4Z+wpt7eyRz5wUVRp2lV/M93c duP8Yhb0AnxSFJgRfIxI/PsJeYAc42y7zf+wHz/Po9jGmikyIFRmobPx9YSaxi17QLCw AJv1cZA3Nbe6AzL3T3UvwG0Lpsqp2hzssp4Os4Emc8XmRdzdq4xrBlVbanrrKycAE9C3 fwdEn4KShDJC8w9AheCpvLdMWeQgD8oBEBPbwF7Wz6wyFeuekCIhM5PNCeC73GIUbl1s V0Tg== X-Gm-Message-State: AJIora93/v5bT/h2UZ98lqV+bqpmnLQN6uD9Ck4bdIROts0ifdZV13/4 rBoVEgb55SIpwfyWMn5tZ0QwDrTRne/iF93t+hbcWOdO X-Google-Smtp-Source: AGRyM1uVAoRM+emJo1cxFUwJOKt69HqIH7ZxjKj/2xlAKABjfjCEeeHGCBr2HRed0nMxzIvC8q+8G6Z3pjmETg6JHaU= X-Received: by 2002:a0c:a995:0:b0:473:4e06:af76 with SMTP id a21-20020a0ca995000000b004734e06af76mr20392372qvb.2.1658148492304; Mon, 18 Jul 2022 05:48:12 -0700 (PDT) MIME-Version: 1.0 References: <1728479877.503410.1657201438041@mail.virginmedia.com> <275535579.503636.1657201578488@mail.virginmedia.com> In-Reply-To: From: Ahmad Ismail Date: Mon, 18 Jul 2022 18:48:00 +0600 Message-ID: Subject: Re: How to parse zsh history To: Bart Schaefer Cc: zsh-user Content-Type: multipart/alternative; boundary="000000000000de645805e413c764" X-Seq: 27895 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: --000000000000de645805e413c764 Content-Type: text/plain; charset="UTF-8" *Thank you very much.* On Fri, Jul 8, 2022 at 12:17 AM Bart Schaefer wrote: > On Thu, Jul 7, 2022 at 6:46 AM Peter Stephenson > wrote: > > > > If you need to load from files before search, fc has numerous options > > for that, including one to load to a local context so you don't pollute > > the global history. > > In particular > fc -p -a /dev/null $(wc -l < $filename) 0 > fc -R $filename > > will load the contents of $filename into $history for the scope of the > containing function, and then discard it when the function returns. > > --000000000000de645805e413c764 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
<= p dir=3D"ltr" style=3D"line-height:1.38;margin-top:0pt;margin-bottom:0pt"><= span style=3D"font-size:10pt;font-family:Arial;color:rgb(0,0,0);background-= color:transparent;font-weight:400;font-style:normal;font-variant:normal;tex= t-decoration:none;vertical-align:baseline;white-space:pre-wrap">Thank you v= ery much.



On Fri, Jul 8, 2022 at 12= :17 AM Bart Schaefer <schae= fer@brasslantern.com> wrote:
On Thu, Jul 7, 2022 at 6:46 AM Peter Stephenson
<p.w.st= ephenson@ntlworld.com> wrote:
>
> If you need to load from files before search, fc has numerous options<= br> > for that, including one to load to a local context so you don't po= llute
> the global history.

In particular
fc -p -a /dev/null $(wc -l < $filename) 0
fc -R $filename

will load the contents of $filename into $history for the scope of the
containing function, and then discard it when the function returns.

--000000000000de645805e413c764--