Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Substituting all but a trailing digit/number
- X-seq: zsh-users 11614
- From: zzapper <david@xxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Substituting all but a trailing digit/number
- Date: Fri, 13 Jul 2007 12:25:40 +0000 (UTC)
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Organization: SuccessTheory
- Sender: news <news@xxxxxxxxxxxxx>
I want to generalise top3 into top4,top5..etc
function top3()
{
# description : vi 3 newest files
file=$0
num=${file//[[:alpha:]]/}
gvim.exe -p $(l\s *(.om[1,$num])) &
}
In the above substitution I get the "number" by stripping out the alphas
which is kind of a trick
But how could I get filter just the trailing number (in VIM I would use
memory)
--
zzapper
http://www.rayninfo.co.uk/vimtips.html
Messages sorted by:
Reverse Date,
Date,
Thread,
Author