Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: refering to 2nd from last history parameter?
- X-seq: zsh-users 19767
- From: Axel Beckert <abe@xxxxxxxxxxxxxxx>
- To: "zsh-users@xxxxxxx" <zsh-users@xxxxxxx>
- Subject: Re: refering to 2nd from last history parameter?
- Date: Thu, 22 Jan 2015 17:09:25 +0100
- Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAAAAAC3mUtaAAAABGdBTUEAALGPC/xhBQAAADh0RVh0U29mdHdhcmUAWFYgVmVyc2lvbiAzLjEwYSAgUmV2OiAxMi8yOS85NCAoUE5HIHBhdGNoIDEuMindFS5JAAACGElEQVQ4jXXQMU8UYRDG8f8shNjdDH4AbpfGDjAWlKiJiZ0ajL1aGCvsNCbGaCGG1koLaztaTYz6ATy+gOyehYmF3MxVxgg3FnDsHcTpJr/M+8w7Rf6nCsaVTTDqxbg9hoOXmw83H71+Eyfg4E1d7/Z2fG9rGkZbTQiu+K+3U/C+76lmkvAhJuDndnoAiftou4V84okAGclop4U/jYACZDTxrYWP0gkxVfAm/W//GLZpxIzwIN0Hn8dw0B+IWkZmQmRsj2HfhwokEklHfNCCiQCRgAR7YyhQVRVTCKCzP4Y5zBBE0t0zY3Q8oQaBqqAMlVEcgVQd9706zGirAFium8HXumlMIeMwqQCInju+2+uB6MRENupdpMt8pRlHZyuAW0F+Mb6XSIVqtxjD+iVmVqqystLEzFTGT92YqRaXpNT5eTVjeJhbALPnrTxLUZUKZsgxcNm64hAOYisT/xhF+oKTGU5RegtC3Rt6eEDi/QnIevdTx9Md2EMmYBRmCQR1026FCGQQJJExsRUqgkMGaWSbwYLnoO4T6VgpbQbdELPMBAHWWrhYrcxXnYgAsatPWygkFCBD4K62MAsOTqA6szYRPpsu6e6Y8mPiVrBMNuGIMrgwBUu4p2DgG1Ownu6hpuTv7hScefHAzAC/yRRw5U5pALMbJ4AUALvHSZhxgHPXTsHcdWD1GadAHr9avP+c0wCr7263Df8ASLwXWHWs+KIAAAAHdElNRQfYBQEBODPr
- In-reply-to: <3006201421941921@web23g.yandex.ru>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mail-followup-to: "zsh-users@xxxxxxx" <zsh-users@xxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- Organization: DeuxChevaux.org -- The Citroën 2CV Database
- References: <XnsA42A7D32D20B8davidrayninfocouk@80.91.229.13> <20150122134016.GV26664@sym.noone.org> <3006201421941921@web23g.yandex.ru>
Hi,
On Thu, Jan 22, 2015 at 06:52:01PM +0300, ZyX wrote:
> > I would have expected that using negativ numbers would work (with
> > CSH_JUNKIE_HISTORY enabled of course):
> >
> > % echo !:-2
> >
> > But this actually seems an abbreviation for
> >
> > % echo !:0-2
> >
> > despite this is not documented in the man page. (I may come up with a
> > documentation patch for that later.)
>
> It is documented:“x-y A range of words; x *defaults to 0*.”
Thanks for the heads up. I actually expected (and looked for) a
literal mention of "-x".
> > I wonder what would be a good syntax for such a feature as "-n"
> > seems already taken. Maybe something "<n" as in e.g.
> >
> > % echo !:<2
> >
> > (And would we count from 0 or from 1, i.e. would "!:<0" or "!:<1" be a
> > synonym for "!:$"? :-)
>
> I would say that `!:<1` resulting in a second word counted from the end is rather unexpected.
Yeah, well, depends. :-)
Kind regards, Axel
--
/~\ Plain Text Ribbon Campaign | Axel Beckert
\ / Say No to HTML in E-Mail and News | abe@xxxxxxxxxxxxxxx (Mail)
X See http://www.nonhtmlmail.org/campaign.html | abe@xxxxxxxxx (Mail+Jabber)
/ \ I love long mails: http://email.is-not-s.ms/ | http://abe.noone.org/ (Web)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author