Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: var expansion in glob pattern?
- X-seq: zsh-users 4767
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>
- To: Sven Guckes <guckes@xxxxxxxxxxxxxxxxx>, zsh-users@xxxxxxxxxx
- Subject: Re: var expansion in glob pattern?
- Date: Sat, 23 Mar 2002 19:36:18 +0000
- In-reply-to: <20020323185649.GA12320@xxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20020323185649.GA12320@xxxxxxxxxxxxxxxxxxxxxx>
On Mar 23, 7:56pm, Sven Guckes wrote:
} Subject: var expansion in glob pattern?
}
} $ for i in 1 2 3 4 5 10 15 20 25 30 35 40 35 40 45 50; do
} ls *(.Lk-$i)|wc -l
} end
} zsh: parse error near `end'
You need "done" rather than "end", there. There's nothing wrong with
the glob expression -- except that passing it as the argument to "ls"
may do the wrong thing when there are no matches at all.
Of course note that the files smaller than 50k includes all the files
smaller than 45k, and so on ... so I'd try:
j=0
for i in 1 2 3 4 5 10 15 20 25 30 35 40 35 40 45 50; do
print ${(l:3:)i}k : "${#${(f)$(print -l *(N.Lk-${i}Lk+${j}))}}"
((j=i-1))
done
print Rest : "${#${(f)$(print -l *(N.Lk+${j}))}}"
Detailed explanation available upon request.
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
Messages sorted by:
Reverse Date,
Date,
Thread,
Author