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

Re: var expansion in glob pattern? - s/end/done/ !



* Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> [2002-03-23 19:36]:
> On Mar 23,  7:56pm, Sven Guckes wrote:
> }   $ 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.

  $ 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
   done
      9
    211
    642
   1298
   2015
   3331
   3882
   4188
   4365
   4493
   4595
   4670
   4595
   4670
   4716
   4757

now it works!  :-)

> 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.

good point!

> Of course note that the files smaller than 50k
> includes all the files smaller than 45k, and so on ...

yep, that's a feature. :-)

Sven



Messages sorted by: Reverse Date, Date, Thread, Author