Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Can I refer to last but one parameter?
- X-seq: zsh-users 11225
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Can I refer to last but one parameter?
- Date: Tue, 27 Feb 2007 12:44:08 +0000
- In-reply-to: <Xns98E47CDE77ADBzzappergmailcom@xxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Organization: Cambridge Silicon Radio
- References: <Xns98E47CDE77ADBzzappergmailcom@xxxxxxxxxxx>
zzapper <david@xxxxxxxxxx> wrote:
> Hi
>
> Can I refer to last but one parameter?
>
> e.g.
>
> vi !$-1 ## wrong does not work
You have to count from the start of the line and used !:<argnum>.
"-" refers exclusively to ranges, even if one of the arguments is missing,
so for example !:-1 means the range of words 0 (the command word) and 1,
while !:$-1 is the not very useful range from the last to the the first
argument.
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php
To get further information regarding CSR, please visit our Investor Relations page at http://ir.csr.com/csr/about/overview
Messages sorted by:
Reverse Date,
Date,
Thread,
Author