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

Re: Neat hash -d trick



On Fri, Oct 22, 2010 at 06:05, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:

> On Oct 22, 12:34am, Nikolai Weibull wrote:
> }
> } for ((i = 1; i < 9; i++)); do
>
> You probably mean <= 9 there? ÂOr just

Yes.

> Âfor i in {1..9}

Ah, of course.

> } Â hash -d .$i=${(j:/:)${(l:2::.:)${(s::)${(l:i::.:)}}}}
>
> Â Âhash -d .$i=${${(l:i*3::../:)}%/}

Again, obvious, once you see it.  I had a feeling my way was
unnecessarily complicated ;-).



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