zsh-users
 help / color / mirror / code / Atom feed
From: zzapper <zsh@rayninfo.co.uk>
To: zsh-users@zsh.org
Subject: Re: Reverse history search and match for a specific token
Date: Tue, 7 Sep 2021 13:59:56 +0100	[thread overview]
Message-ID: <25be0b2e-5ac1-bd51-8bf7-1ddb601ae181@rayninfo.co.uk> (raw)
In-Reply-To: <20210907105355.atgr45xbrjgbjtwr@trustfood.org>


On 07/09/2021 11:53, Eric Smith wrote:
> Hi zshellers,
>
> I use event history matching a fair amount and can subscript the command to return a specific token like this.
> $ !?foo?:%
> for the token containing foo
> $ !?foo?:$
> for the last token
>
> How would I match for the token containing `bar`?
>
> Thanks for the tips.
>
> Best wishes
> Eric

echo !?foo?:2 # second

echo !?foo?:0 # first

echo !?foo?:%   # token

echo !?foo?:$   # last

That's all I know await other answers

zzapper



  reply	other threads:[~2021-09-07 13:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-07 10:53 Eric Smith
2021-09-07 12:59 ` zzapper [this message]
2021-09-07 21:30 ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=25be0b2e-5ac1-bd51-8bf7-1ddb601ae181@rayninfo.co.uk \
    --to=zsh@rayninfo.co.uk \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).