Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: how do I get the last argument from a list of arguments?
- X-seq: zsh-users 18934
- From: zzapper <david@xxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: how do I get the last argument from a list of arguments?
- Date: Tue, 8 Jul 2014 12:52:00 +0000 (UTC)
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- Organization: Your Company
- References: <CADjGqHuALx7Ue3Ei3s7XvT_pHWxECo2rt=BNegPO5Fwcuge2LQ@mail.gmail.com>
TJ Luoma <luomat@xxxxxxxxx> wrote in
news:CADjGqHuALx7Ue3Ei3s7XvT_pHWxECo2rt=BNegPO5Fwcuge2LQ@xxxxxxxxxxxxxx:
> Iâ??m trying to learn better ways of dealing with arguments given to a
> function, because I am sure that I am not doing it the most efficient
> way.
Similar to Kurtis
p()
{
echo "last ${@[-1]}"
echo "2nd last ${@[-2]}"
}
p a b c d
--
zzapper
https://twitter.com/dailyzshtip
---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com
Messages sorted by:
Reverse Date,
Date,
Thread,
Author