Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: refering to 2nd from last history parameter?
- X-seq: zsh-users 19782
- From: Axel Beckert <abe@xxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: refering to 2nd from last history parameter?
- Date: Mon, 26 Jan 2015 14:17:23 +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: <20150126121649.684c22cb@pwslap01u.europe.root.pri>
- 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
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- Organization: DeuxChevaux.org -- The Citroën 2CV Database
- References: <XnsA42A7D32D20B8davidrayninfocouk@80.91.229.13> <CAECNH1RyC2Q-5y3Ynk-F+cJvtRvFPWdvcpDOqXmrJB=uSJCbTQ@mail.gmail.com> <XnsA42E7AF6C5E7davidrayninfocouk@80.91.229.13> <20150126121649.684c22cb@pwslap01u.europe.root.pri>
Hi,
On Mon, Jan 26, 2015 at 12:16:49PM +0000, Peter Stephenson wrote:
> On Mon, 26 Jan 2015 12:05:14 +0000
> We could special case the meaning here: given that ranges have to be in
> order, a range starting with "$" is by definition useless. It's a bit
> kludgy but this is !-history so it's hard to imagine anyone looking for
> elegance. Does this break anything?
Depends.
I'd expect that
mkdir foo
mv foo foo-1
can be abbreviated
mkdir foo
mv !$ !$-1
i.e. that anything behind "!$" except a colon (as in "!$:t" or "!$:h")
is taken literal.
> I was wondering about using a different character, but I think any
> solution where "minus" is not encoded by "-" is too obscure to be
> useful.
I'd still prefer the form of "!!:<1" or shorter "!<2" instead of
anything involving further characters after "$".
Additionally, I thought we're talking about picking a single argument
counting from the back, not from ranges of arguments -- which then could
be "!<2-4" or "!<4-2". (I'd allow both forms as both can make sense.)
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