Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Substituting all but a trailing digit/number



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